#include using namespace std; int main(){ string ans = "",gomi; for(int digit = 0;digit < 10;digit++){ for(int i = 0,x,keep;i < 10;i++){ for(int j = 0;j < digit;j++) cout << '0'; cout << i; for(int j = digit + 1;j < 10;j++) cout << '0'; cout << endl; cin >> x >> gomi; if(x == 10) return 0; if(i == 0) keep = x; else if(x > keep){ ans += to_string(i); break; }else if(x < keep){ ans += to_string(i - 1); break; } } } cout << ans << endl; }