#include #include #include using namespace std; int main(){ vector> alphabet; vector letter; letter = { ".........", ".........", ".........", ".........", "....*....", "...##....", "..#.#....", ".#..#....", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", ".###*....", "....#....", "....#....", "....#....", "........." }; alphabet.push_back(letter); letter = { ".........", ".#.......", "..#......", "...#.....", "....*....", "....#....", "....#....", "....#....", "........." }; alphabet.push_back(letter); letter = { ".........", "....#....", "....#....", "....#....", "....*....", "....#....", "....#....", "....#....", "........." }; alphabet.push_back(letter); letter = { ".........", ".......#.", "......#..", ".....#...", "....*....", "....#....", "....#....", "....#....", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", "....*###.", "....#....", "....#....", "....#....", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", "....*....", "....##...", "....#.#..", "....#..#.", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", ".###*....", "...#.....", "..#......", ".#.......", "........." }; alphabet.push_back(letter); letter = { ".........", ".#.......", "..#......", "...#.....", "....*....", "...#.....", "..#......", ".#.......", "........." }; alphabet.push_back(letter); letter = { ".........", "....#....", "....#....", "....#....", "....*###.", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", "....#....", "....#....", "....#....", "....*....", "...#.....", "..#......", ".#.......", "........." }; alphabet.push_back(letter); letter = { ".........", ".......#.", "......#..", ".....#...", "....*....", "...#.....", "..#......", ".#.......", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", "....*###.", "...#.....", "..#......", ".#.......", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", "....*....", "...#.#...", "..#...#..", ".#.....#.", "........." }; alphabet.push_back(letter); letter = { ".........", ".#.......", "..#......", "...#.....", ".###*....", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", "....#....", "....#....", "....#....", ".###*....", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".......#.", "......#..", ".....#...", ".###*....", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", ".###*###.", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", ".###*....", ".....#...", "......#..", ".......#.", "........." }; alphabet.push_back(letter); letter = { ".........", ".#..#....", "..#.#....", "...##....", "....*....", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".#.....#.", "..#...#..", "...#.#...", "....*....", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", "....#....", "....#....", "....#....", "....*....", ".....#...", "......#..", ".......#.", "........." }; alphabet.push_back(letter); letter = { ".........", ".......#.", "......#..", ".....#...", "....*###.", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".......#.", "......#..", ".....#...", "....*....", ".....#...", "......#..", ".......#.", "........." }; alphabet.push_back(letter); letter = { ".........", ".#.......", "..#......", "...#.....", "....*###.", ".........", ".........", ".........", "........." }; alphabet.push_back(letter); letter = { ".........", ".........", ".........", ".........", "....*###.", ".....#...", "......#..", ".......#.", "........." }; alphabet.push_back(letter); int n, c; cin >> n >> c; string buffer; vector> input(n, vector()); vector> output; for (int i = 0; i < n; i++){ for (int j = 0; j < 9; j ++){ cin >> buffer; input[i].push_back(buffer); } } for (int i = 0; i < n; i++){ for (int j = 0; j < alphabet.size(); j++){ if (input[i] == alphabet[j]){ if (c + j > 25){ output.push_back(alphabet[c + j - 26]); } else { output.push_back(alphabet[c + j]); } break; } } } for (int i = 0; i < output.size(); i++){ for (int j = 0; j < 9; j++){ cout << output[i][j] << endl; } } return 0; }