#include #include #include #include #include #include #include using namespace std; template void setmin(T& a, T b) { a = min(a, b); } template void setmax(T& a, T b) { a = max(a, b); } int main() { cin.tie(0); ios::sync_with_stdio(false); string ans = "0000000000", res; int pn; cout << ans << endl; cout.flush(); cin >> pn >> res; if(res == "unlocked") return 0; for(int i = 0; i < 10; i++) { int n, maxj, maxn = -1; for(int j = 0; j < 10; j++) { ans[i] = '0' + j; cout << ans << endl; cout.flush(); cin >> n >> res; if(res == "unlocked") return 0; if(maxn == -1 || maxn < n) { maxj = j; maxn = n; } } ans[i] = '0' + maxj; } }