#include using namespace std; #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define eprintf(...) 42 #endif #define rep(i,n) for(int i=0;i<(int)(n);i++) #define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define all(x) (x).begin(),(x).end() #define foreach(u,v) for(auto (u) : (v)) #define pb push_back #define mp make_pair #define mt make_tuple typedef long long ll; typedef pair pii; typedef vector vi; typedef vector vvi; typedef pair pll; typedef vector vl; const int inf = 1e9; const ll linf = 1LL<<60; const ll mod = 1e9 + 7; const double eps = 1e-9; /* */ int ask(string s) { cout << s << endl; int x; cin >> x >> s; return x; } int main() { int ret; string ans = "0123456789"; vi cnt(10); int zero = -1; rep(i, 10){ string t; rep(j, 10) t += (i+'0'); ret = ask(t); if(ret == 10) return 0; if(ret == 0) zero = i; cnt[i] = ret; } if(zero == -1){ int x, y; rep(i, 10){ string t; rep(j, 10){ if(i == j) t += '1'; else t += '0'; } ret = ask(t); if(ret == 10) return 0; if(ret == 2) x = i; } rep(i, 10){ string t; rep(j, 10){ if(i == j) t += '0'; else t += '1'; } ret = ask(t); if(ret == 10) return 0; if(ret == 2) y = i; } ans[x] = '1'; ans[y] = '0'; repi(i, 2, 10){ rep(j, 10){ string t; rep(k, 10){ if(j == k) t += (i+'0'); else{ if(x != k) t += '1'; else t += '0'; } } ret = ask(t); if(ret == 10) return 0; if(ret) ans[j] = i+'0'; } } }else{ rep(i, 10) if(cnt[i]){ rep(j, 10){ string t; rep(k, 10){ if(j == k) t += (i+'0'); else t += (zero+'0'); } ret = ask(t); if(ret == 10) return 0; if(ret) ans[j] = i+'0'; } } } cout << ans << endl; return 0; }