#include #define int long long #define double long double #define F first #define S second using namespace std; void solve(){ vector> stril[8]={ {{5,4},{6,4},{7,4}}, {{5,3},{6,2},{7,1}}, {{4,1},{4,2},{4,3}}, {{1,1},{2,2},{3,3}}, {{1,4},{2,4},{3,4}}, {{3,5},{2,6},{1,7}}, {{4,5},{4,6},{4,7}}, {{5,5},{6,6},{7,7}}, }; map>mp; mp['a']={1,0}; mp['b']={2,0}; mp['c']={3,0}; mp['d']={4,0}; mp['e']={5,0}; mp['f']={6,0}; mp['g']={7,0}; mp['h']={2,1}; mp['i']={3,1}; mp['j']={6,4}; mp['k']={4,1}; mp['l']={5,1}; mp['m']={6,1}; mp['n']={7,1}; mp['o']={3,2}; mp['p']={4,2}; mp['q']={5,2}; mp['r']={6,2}; mp['s']={7,2}; mp['t']={4,3}; mp['u']={5,3}; mp['v']={7,4}; mp['w']={6,5}; mp['x']={7,5}; mp['y']={6,3}; mp['z']={7,6}; map,char>mp1; for(char a='a';a<='z';a++){ assert(mp.find(a)!=mp.end()); paird=mp[a]; mp1[d]=a; } int n,q; cin>>n>>q; char cur[9][9]; char out[9][9]; for(int c=0;c>cur[i][j]; } } vectorstr; int cu=0; for(auto st:stril){ bool f=1; for(auto &[x,y]:st){ if(cur[x][y]=='.'){ f=0; } } if(f){ str.push_back(cu); } cu++; } sort(str.begin(),str.end()); reverse(str.begin(),str.end()); assert(str.size()==2); char from=mp1[{str[0],str[1]}]; char to=from+q; if(to>'z'){ to-=26; } //cout<>t; for(int i=1;i<=t;i++){ solve(); } return 0; }