#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< P; char s[325]; int p0, p1, p2; int qcnt; void query(){ puts(s); fflush(stdout); scanf("%d%d%d",&p0,&p1,&p2); qcnt++; } void clear(){ REP(i,100){ s[3*i] = '?'; s[3*i+1] = '?'; s[3*i+2] = ' '; } s[299] = '\0'; } void setval(int p, int u, int d){ s[3*p] = u==-1 ? '?' : u+'0'; s[3*p+1] = d==-1 ? '?' : d+'0'; } int ans[125]; void solve(){ REP(i,20){ int base = 5*i; vi dcnt(10, 0); REP(j,9){ clear(); REP(k,5)setval(base+k, -1, j); query(); dcnt[j] = p1; } dcnt[9] = 5 - accumulate(ALL(dcnt), 0); REP(j,10)if(dcnt[j]>0){ REP(m,1<<5)if(__builtin_popcount(m)==dcnt[j]){ clear(); REP(k,5)if((m>>k)&1)setval(base+k, -1, j); query(); if(p1==dcnt[j]){ REP(k,5)if((m>>k)&1)ans[base+k] += j; } } } vi ucnt(10, 0); REP(j,9){ clear(); REP(k,5)setval(base+k, j, -1); query(); ucnt[j] = p1; } ucnt[9] = 5 - accumulate(ALL(ucnt), 0); REP(j,10)if(ucnt[j]>0){ REP(m,1<<5)if(__builtin_popcount(m)==ucnt[j]){ clear(); REP(k,5)if((m>>k)&1)setval(base+k, j, -1); query(); if(p1==ucnt[j]){ REP(k,5)if((m>>k)&1)ans[base+k] += j*10; } } } // printf("! "); // REP(k,5)printf("%02d ", ans[base+k]); // puts(""); // fflush(stdout); } // printf("! "); REP(i,100)printf("%02d%c",ans[i],i==99?'\n':' '); // printf("! %d\n", qcnt); fflush(stdout); return; } int main(){ int q; cin>>q; solve(); return 0; }