#include int main() { std::string str; std::string res = "0000000000"; for(int i = 0; i < 10; ++i) { int maxj = 0; int max = -1; int x; for(int j = 0; j < 10; ++j) { res[i] = (char)(j + '0'); std::cout << res << std::endl; std::cin >> x >> str; if( max < x ) { max = x; maxj = j; } if( str == "unlocked" ) return 0; } res[i] = (char)(maxj + '0'); } return 0; }