#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define DREP(i,n) for(int i=n;i>0;i--) #define Rep(i,m,n) for(int i=m;i vi; typedef vector> vvi; typedef pair pdd; typedef pair pii; const double pi = acos(-1.0); double rad(double t){return t*pi/180.0;} double deg(double d){return d*180.0/pi;} templateT GCD(T x,T y){return y?GCD(y,x%y):x;} templateT LCM(T x,T y){return x/GCD(x,y)*y;} templateostream& operator<<(ostream& os,const set& s){os<<"{";for(auto itr=s.begin();s.end() != itr;++itr){if(itr!=s.begin())os<<',';os<<*itr;}os<<"}";return os;} templateostream& operator<<(ostream& os,const pair& p){os<<'('< ask(LL key){ string Key; for(int i=0;i<10;++i){ Key.pb('0'+key%10); key/=10; } reverse(all(Key)); cout << Key << endl; pair ret; cin >> ret.first >> ret.second; return ret; } int identify(const int k){ int max_x=0,max_i; for(int i=0;i<10;i++){ pair ans = ask((LL)pow(10,9-k)*i); if(ans.second=="unlocked")return 10; if(ans.first>max_x){ max_x=ans.first; max_i=i; } } return max_i; } int main(){ ios::sync_with_stdio(false); string lock; int ans; LL key=0; for(int i=0;i<10;i++){ ans=identify(i); if(ans==10)break; key = key*10 + ans; } if(ans!=10){ ask(key); } return 0; }