#include "bits/stdc++.h" using namespace std; #define int long long #define FOR(i, a, b) for(int i=(a);i<(b);i++) #define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--) #define REP(i, n) for(int i=0; i<(n); i++) #define RREP(i, n) for(int i=(n-1); i>=0; i--) #define ALL(a) (a).begin(),(a).end() #define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end()); #define CONTAIN(a, b) find(ALL(a), (b)) != (a).end() #define array2(type, x, y) array, x> #define vector2(type) vector > #define out(...) printf(__VA_ARGS__);fflush(stdout); int dxy[] = {0, 1, 0, -1, 0}; void solve(); signed main() { cin.tie(0); ios::sync_with_stdio(false); solve(); return 0; } /*================================*/ int N,M,Q; void solve() { int A[4]; REP(i,4)A[i]=i; int S0,S1,T; int F[4]; REP(i,4)F[i]=-1; while(true) { out("%lld %lld %lld %lld\n", A[0],A[1],A[2],A[3]); cin>>S0>>T; if (S0 == 4) return; if (S0) { REP(i,4) { if (F[i]>-1) continue; A[i] = (A[i]+4)%10; out("%lld %lld %lld %lld\n", A[0],A[1],A[2],A[3]); cin>>S1>>T; if (S1 == 4) return; A[i]=(A[i]+6)%10; if (S1!=S0) { F[i]=A[i]; break; } } } int ok = true; REP(i,4) ok &= F[i]>-1; if (ok) break; REP(i,4) A[i]=(A[i]+1)%10; } out("%lld %lld %lld %lld\n", F[0],F[1],F[2],F[3]); }