#include using namespace std; using ll = long long; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)< Q){ cout << Q[0]; FOR(i, 1, 4){ cout << " " << Q[i]; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); vector Q(4); FOR(i, 0, 10){ FOR(j, i+1, 10){ FOR(k, j+1, 10){ FOR(l, k+1, 10){ Q[0] = i; Q[1] = j; Q[2] = k; Q[3] = l; query(Q); ll x, y; cin >> x >> y; if(x+y==4){ goto HERE; } } } } } HERE: do { query(Q); ll x, y; cin >> x >> y; if(x==4) return 0; } while (next_permutation(ALL(Q))); return 0; }