#pragma GCC optimize ("O3") #pragma GCC target ("avx") #pragma GCC optimize ("Ofast") #include #include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define REP(i, m, n) for (int i = (m); i < (n); ++i) #define gc getchar_unlocked #define pc putchar_unlocked //#define gc _getchar_nolock //#define pc _putchar_nolock inline int input()noexcept { int v = 0; char c = gc(); for (; isdigit(c); c = gc()) { v *= 10; v += c - '0'; } return v; } char ans[10]; inline void out() { rep(i, 10)pc(ans[i]); pc('\n'); fflush(stdout); } int main() { rep(i, 10)ans[i] = '0'; rep(i, 10) { out(); int a = input(); if (a == 10)return 0; rep(_, 7)gc(); REP(j, 1, 10) { ans[i] = '0' + j; out(); int b = input(); if (b == 10)return 0; rep(_, 7)gc(); if (a > b) { ans[i] = '0'; break; } else if (a < b) { break; } } } out(); if (input() != 10) { puts("?!"); } }