#include #include #include using namespace std; int alp[26] = {48, 80, 114, 17, 18, 20, 24, 96, 160, 5, 33, 34, 36, 40, 192, 65, 66, 68, 72, 129, 130, 9, 6, 10, 132, 12}; int get_letter() { string row; for(int i = 0; i < 3; i++) cin >> row; int sum = 0; cin >> row; if(row[3] == '#') sum += 128; if(row[4] == '#') sum += 1; if(row[5] == '#') sum += 2; cin >> row; if(row[3] == '#') sum += 64; if(row[5] == '#') sum += 4; cin >> row; if(row[3] == '#') sum += 32; if(row[4] == '#') sum += 16; if(row[5] == '#') sum += 8; for(int i = 0; i < 3; i++) cin >> row; return sum; } void print_letter(int xd) { cout << ".........\n"; cout << "." << (xd & 128 ? "#" : ".") << ".." << (xd & 1 ? "#" : ".") << ".." << (xd & 2 ? "#" : ".") << ".\n"; cout << ".." << (xd & 128 ? "#" : ".") << "." << (xd & 1 ? "#" : ".") << "." << (xd & 2 ? "#" : ".") << "..\n"; cout << "..." << (xd & 128 ? "#" : ".") << (xd & 1 ? "#" : ".") << (xd & 2 ? "#" : ".") << "...\n"; cout << "." << (xd & 64 ? "###" : "...") << "*" << (xd & 4 ? "###" : "...") << ".\n"; cout << "..." << (xd & 32 ? "#" : ".") << (xd & 16 ? "#" : ".") << (xd & 8 ? "#" : ".") << "...\n"; cout << ".." << (xd & 32 ? "#" : ".") << "." << (xd & 16 ? "#" : ".") << "." << (xd & 8 ? "#" : ".") << "..\n"; cout << "." << (xd & 32 ? "#" : ".") << ".." << (xd & 16 ? "#" : ".") << ".." << (xd & 8 ? "#" : ".") << ".\n"; cout << ".........\n"; } int main(){ int N, C; cin >> N >> C; vector to_print; for(int i = 0; i < N; i++) { int letter_combo = get_letter(); for(int j = 0; j < 26; j++) { if(alp[j] == letter_combo) to_print.push_back(alp[(j + C) % 26]); } } for(int l : to_print) print_letter(l); } /* 2 9 ......... ......... ......... ......... .###*.... .....#... ......#.. .......#. ......... ......... .......#. ......#.. .....#... ....*.... ...#..... ..#...... .#....... ......... */