#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { int q = 10, ex = 0; string base = "0000000000"; vector num(10), ans(10); while (q--){ int ans1; string s = "", t; for (int i = 0; i < 10; i++) s += to_string(q); cout << s << endl; cin >> ans1 >> t; if (ans1 == 10) { cout << s << endl; } if (!ans1){ ex = 1; } num[q] = ans1; } q = 10; while (q--){ int ans1; string s; if (num[q] == 0) continue; for (int i = 0; i < 10; i++) { string base1 = base; if (q == 0) base1 = "1111111111"; base1[i] = '0'+ q; cout << base1 << endl; cin >> ans1 >> s; if (ans1 == 10) { cout << base1 << endl; return 0; } if (q != 0) { if (ans1 == num[0]+1) ans[i] = q; } else { if (ans1 == num[1]+1) ans[i] = 0; } } } for (auto x : ans) cout << x; cout << endl; }