#include #include #include #include using namespace std; pair query(string s){ cout << "? " << s << endl; int h,b; cin >> h >> b; return {h,b}; } void ans(string s){ cout << "! " << s << endl; int x; cin >> x; } void solve(){ int i,j; pair p = query("0123"); if(p.first + p.second==4){ vector v = {"0213","0312","0321","1023","1230"}; string st; for(auto s:v){ auto [h,_] = query(s); if(h==4) st = s; } ans(st); }else if(p.first + p.second==3){ if(p.first==3){ string s = "0x23"; string st = "0923"; for(i=4;i<9;i++){ s[1] = (char)('0' + i); auto [h,_] = query(s); if(h==4) st = s; } ans(s); }else if(p.second==3){ string s = "120x"; string st = "1209"; for(i=4;i<9;i++){ s[3] = (char)('0' + i); auto [h,_] = query(s); if(h==4) st = s; } ans(s); }else{ vector s = {"0x12","0x13","0x21","0x31","10x3"}; string st; char num = '9'; for(i=4;i<9;i++){ string ss = s[i - 4]; char c = (char)('0' + i); for(j=0;j=2) st[1] = X[1], st[3] = Y[1]; else st[1] = Y[1], st[3] = X[1]; }else{ if(h4>=2) st[1] = X[1], st[3] = Y[0]; else st[1] = Y[0], st[3] = X[1]; } } auto [h6,b6] = query(st); if(h6!=4) st[2] = '2'; ans(st); }else{ assert(false); } } int main(){ int i,t; cin >> t; while(t){ t--; solve(); } }