#include #include using namespace std; char map[256]; unsigned char map2[26] = { 0b00000110, 0b00010010, 0b10000010, 0b01000010, 0b00100010, 0b00001010, 0b00000011, 0b00010100, 0b10000100, 0b01001000, 0b01000100, 0b00100100, 0b00001100, 0b00000101, 0b10010000, 0b01010000, 0b00110000, 0b00011000, 0b00010001, 0b11000000, 0b10100000, 0b01000001, 0b00101000, 0b00100001, 0b10001000, 0b00001001, }; void init_map() { map[0b00000110] = 'a'; map[0b00010010] = 'b'; map[0b10000010] = 'c'; map[0b01000010] = 'd'; map[0b00100010] = 'e'; map[0b00001010] = 'f'; map[0b00000011] = 'g'; map[0b00010100] = 'h'; map[0b10000100] = 'i'; map[0b01001000] = 'j'; map[0b01000100] = 'k'; map[0b00100100] = 'l'; map[0b00001100] = 'm'; map[0b00000101] = 'n'; map[0b10010000] = 'o'; map[0b01010000] = 'p'; map[0b00110000] = 'q'; map[0b00011000] = 'r'; map[0b00010001] = 's'; map[0b11000000] = 't'; map[0b10100000] = 'u'; map[0b01000001] = 'v'; map[0b00101000] = 'w'; map[0b00100001] = 'x'; map[0b10001000] = 'y'; map[0b00001001] = 'z'; } void print_char(char c) { int idx = map2[c - 'a']; printf(".........\n"); // line 2 printf("."); if (idx & (1 << 7)) printf("#"); else printf("."); printf(".."); if (idx & (1 << 6)) printf("#"); else printf("."); printf(".."); if (idx & (1 << 5)) printf("#"); else printf("."); printf(".\n"); // line 3 printf(".."); if (idx & (1 << 7)) printf("#"); else printf("."); printf("."); if (idx & (1 << 6)) printf("#"); else printf("."); printf("."); if (idx & (1 << 5)) printf("#"); else printf("."); printf("..\n"); // line 4 printf("..."); if (idx & (1 << 7)) printf("#"); else printf("."); if (idx & (1 << 6)) printf("#"); else printf("."); if (idx & (1 << 5)) printf("#"); else printf("."); printf("...\n"); // line 5 printf("."); if (idx & (1 << 4)) printf("###"); else printf("..."); printf("*"); if (idx & (1 << 3)) printf("###"); else printf("..."); printf(".\n"); // line 6 printf("..."); if (idx & (1 << 2)) printf("#"); else printf("."); if (idx & (1 << 1)) printf("#"); else printf("."); if (idx & (1 << 0)) printf("#"); else printf("."); printf("...\n"); // line 7 printf(".."); if (idx & (1 << 2)) printf("#"); else printf("."); printf("."); if (idx & (1 << 1)) printf("#"); else printf("."); printf("."); if (idx & (1 << 0)) printf("#"); else printf("."); printf("..\n"); // line 8 printf("."); if (idx & (1 << 2)) printf("#"); else printf("."); printf(".."); if (idx & (1 << 1)) printf("#"); else printf("."); printf(".."); if (idx & (1 << 0)) printf("#"); else printf("."); printf(".\n"); printf(".........\n"); } string line; char get_char() { int index = 0; getline(cin, line); getline(cin, line); if (line[1] == '#') index |= (1 << 7); if (line[4] == '#') index |= (1 << 6); if (line[7] == '#') index |= (1 << 5); getline(cin, line); getline(cin, line); getline(cin, line); if (line[1] == '#') index |= (1 << 4); if (line[7] == '#') index |= (1 << 3); getline(cin, line); getline(cin, line); getline(cin, line); if (line[1] == '#') index |= (1 << 2); if (line[4] == '#') index |= (1 << 1); if (line[7] == '#') index |= (1 << 0); getline(cin, line); return map[index]; } int main() { init_map(); int count; int offset; scanf("%d %d\n", &count, &offset); for (int i = 0; i < count; i++) { char c = get_char(); int idx = c - 'a'; idx += offset; idx %= 26; print_char(idx + 'a'); } }