#include #include int main() { using namespace std; vector> alphabet; pair a = make_pair('a', """........." "........." "........." "........." "....*...." "...##...." "..#.#...." ".#..#..." "........."""); pair b = make_pair('b', """........." "........." "........." "........." ".###*...." "....#...." "....#...." "....#...." "........."""); pair c = make_pair('c', """........." ".#......." "..#......" "...#....." "....*...." "....#...." "....#...." "....#...." "........."""); pair d = make_pair('d', """........." "....#...." "....#...." "....#...." "....*...." "....#...." "....#...." "....#...." "........."""); pair e = make_pair('e', """........." ".......#." "......#.." ".....#..." "....*...." "....#...." "....#...." "....#...." "........."""); pair f = make_pair('f', """........." "........." "........." "........." "....*###." "....#...." "....#...." "....#...." "........."""); pair g = make_pair('g', """........." "........." "........." "........." "....*...." "....##..." "....#.#.." "....#..#." "........."""); pair h = make_pair('h', """........." "........." "........." "........." ".###*...." "...#....." "..#......" ".#......." "........."""); pair i = make_pair('i', """........." ".#......." "..#......" "...#....." "....*...." "...#....." "..#......" ".#......." "........."""); pair j = make_pair('j', """........." "....#...." "....#...." "....#...." "....*###." "........." "........." "........." "........."""); pair k = make_pair('k', """........." "....#...." "....#...." "....#...." "....*...." "...#....." "..#......" ".#......." "........."""); pair l = make_pair('l', """........." ".......#." "......#.." ".....#..." "....*...." "...#....." "..#......" ".#......." "........."""); pair m = make_pair('m', """........." "........." "........." "........." "....*###." "...#....." "..#......" ".#......." "........."""); pair n = make_pair('n', """........." "........." "........." "........." "....*...." "...#.#..." "..#...#.." ".#.....#." "........."""); pair o = make_pair('o', """........." ".#......." "..#......" "...#....." ".###*...." "........." "........." "........." "........."""); pair p = make_pair('p', """........." "....#...." "....#...." "....#...." ".###*...." "........." "........." "........." "........."""); pair q = make_pair('q', """........." ".......#." "......#.." ".....#..." ".###*...." "........." "........." "........." "........."""); pair r = make_pair('r', """........." "........." "........." "........." ".###*###." "........." "........." "........." "........."""); pair s = make_pair('s', """........." "........." "........." "........." ".###*...." ".....#..." "......#.." ".......#." "........."""); pair t = make_pair('t', """........." ".#..#...." "..#.#...." "...##...." "....*...." "........." "........." "........." "........."""); pair u = make_pair('u', """........." ".#.....#." "..#...#.." "...#.#..." "....*...." "........." "........." "........." "........."""); pair v = make_pair('v', """........." "....#...." "....#...." "....#...." "....*...." ".....#..." "......#.." ".......#." "........."""); pair w = make_pair('w', """........." ".......#." "......#.." ".....#..." "....*###." "........." "........." "........." "........."""); pair x = make_pair('x', """........." ".......#." "......#.." ".....#..." "....*...." ".....#..." "......#.." ".......#." "........."""); pair y = make_pair('y', """........." ".#......." "..#......" "...#....." "....*###." "........." "........." "........." "........."""); pair z = make_pair('z', """........." "........." "........." "........." "....*###." ".....#..." "......#.." ".......#." "........."""); alphabet.push_back(a); alphabet.push_back(b); alphabet.push_back(c); alphabet.push_back(d); alphabet.push_back(e); alphabet.push_back(f); alphabet.push_back(g); alphabet.push_back(h); alphabet.push_back(i); alphabet.push_back(j); alphabet.push_back(k); alphabet.push_back(l); alphabet.push_back(m); alphabet.push_back(n); alphabet.push_back(o); alphabet.push_back(p); alphabet.push_back(q); alphabet.push_back(r); alphabet.push_back(s); alphabet.push_back(t); alphabet.push_back(u); alphabet.push_back(v); alphabet.push_back(w); alphabet.push_back(x); alphabet.push_back(y); alphabet.push_back(z); //cout << alphabet[0].second << '\n'; int length; int offset; //std::string characters; std::cin >> length >> offset; //std::cout << "Len: " << length << "\nOffset: " << offset << std::endl; string line; string character; for (int i = 0; i < length; ++i) { character = ""; for (int j = 0; j < 9; ++j) { cin >> line; character += line; } char encrypted; for (auto p : alphabet) { if (p.second == character) { encrypted = p.first - 'a'; break; } } char decrypted = ((encrypted + offset) % 26 + 'a'); for (auto p : alphabet) { if (decrypted == p.first) { int counter = 0; for (char c: p.second) { if (counter % 9 == 8) { cout << c << '\n'; } else { cout << c; } counter++; } } } } //std::cout << std::endl; /*int counter = 1; for (char c : characters) { std::cout << (counter % 9 == 0 ? characters + "\n" : characters); ++counter; }*/ }