#include #include #include #include #include using namespace std; typedef unsigned int uint; typedef unsigned long ulong; typedef long long int ll; int main() { ll answer = 0; ll targetmask = 1; ll responce1 = 0; string responce2; ll lastnumber = -1; while (true) { printf("%010d\n", answer); cin >> responce1 >> responce2; if (responce2 == "unlocked") { return 0; } else { if (lastnumber == -1) lastnumber = responce1; if (responce1 < lastnumber) { answer -= targetmask; targetmask *= 10; lastnumber = responce1 + 1; } else if (responce1 > lastnumber) { targetmask *= 10; lastnumber = responce1; } else { lastnumber = responce1; answer += targetmask; } } } return 0; }