#include #include #include #include #include using namespace std; typedef unsigned int uint; typedef unsigned long ulong; int main() { ulong answer = 0; ulong targetmask = 1; ulong responce1 = 0; string responce2; ulong 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; }