#include using namespace std; signed main(){ ios::sync_with_stdio( 0 ); vector< int > match( 10 ); for( int i = 0; i < 10; ++i ){ string s; for( int j = 0; j < 10; ++j ) s += ( char ) ( '0' + i ); cout << s << endl; string reply; cin >> match[ i ] >> reply; } string s; for( int i = 0; i < 10; ++i ) for( int j = 0; j < match[ i ]; ++j ) s += ( char ) ( '0' + i ); do{ cout << s << endl; int m; string reply; cin >> m >> reply; if( reply == "unlocked" ) break; } while( next_permutation( s.begin(), s.end() ) ); return 0; }