#include #include #include #include #include using namespace std; typedef long long int ll; string s; int x; void ask(string s){ cout << s << endl; string t; cin >> x >> t; if(t=="unlocked")exit(0); } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); s=""; for(int i=0;i<10;i++){ s+='0'; } int id=0; while(1){ ask(s); int xx=x; s[id]='1'; ask(s); if(x==xx){ for(int i=2;i<=9;i++){ s[id]=(char)('0'+i); ask(s); if(x>xx){ id++; break; } } } else if(xx>x){ s[id]='0'; id++; } else{ s[id]='1'; id++; } } }