#include using namespace std; #define For(i, a, n) for(int i =a;i pii; template void dbg(Args&&... args){ ((cerr< pair operator+(const pair&a, const pair& b){ return {a.first +b.first, a.second + b.second}; } template ostream& operator<< (ostream& os, const pair& a){ return os<<"("< basic_ostream& operator<<(basic_ostream& os, const C&c){ for(auto it=begin(c); it!=end(c);++it){ os<<(it==begin(c)?"":" ")<<*it; } return os; } pii load(){ pii ans; vector rows(9); For(i,0,9){ cin >> rows[i]; } bool other = false; if(rows[3][3] == '#'){ if(other){ ans.second = 0; return ans; }else{ ans.first = 0; other = true; } } if(rows[3][4] == '#'){ if(other){ ans.second = 1; return ans; }else{ ans.first = 1; other = true; } } if(rows[3][5] == '#'){ if(other){ ans.second = 2; return ans; }else{ ans.first = 2; other = true; } } if(rows[4][3] == '#'){ if(other){ ans.second = 3; return ans; }else{ ans.first = 3; other = true; } } if(rows[4][5] == '#'){ if(other){ ans.second = 4; return ans; }else{ ans.first = 4; other = true; } } if(rows[5][3] == '#'){ if(other){ ans.second = 5; return ans; }else{ ans.first = 5; other = true; } } if(rows[5][4] == '#'){ if(other){ ans.second = 6; return ans; }else{ ans.first = 6; other = true; } } if(rows[5][5] == '#'){ if(other){ ans.second = 7; return ans; }else{ ans.first = 7; other = true; } } } void output(pii code){ vector yes(9); For(i,0,9){ yes[i] = "........."; } yes[4][4] = '*'; vec vecs = {{-1,-1},{0,-1},{1,-1},{-1,0},{1,0},{-1,1},{0,1},{1,1}}; pii one = vecs[code.first]; pii other = vecs[code.second]; For(i,1,4){ yes[4+i*one.second][4+i*one.first] = '#'; yes[4+i*other.second][4+i*other.first] = '#'; } For(i,0,9){ cout << yes[i] << "\n"; } } void solve(){ ll n,c; cin >> n >> c; vec ab = {{5,6},{3,6},{0,6},{1,6},{2,6}, {4,6},{6,7},{3,5},{0,5},{1,4}, {1,5},{2,5},{4,5},{5,7},{0,3}, {1,3},{2,3},{3,4},{3,7},{0,1}, {0,2},{1,7},{2,4},{2,7},{0,4}, {4,7}}; For(i,0,n){ pii letter = load(); For(i,0,26){ if(ab[i] == letter){ output(ab[(i+c)%26]); break; } } } } main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); int t=1;//cin>>t; while(t--){ solve(); } }