#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; FOR(i, 0, 10){ FOR(j, i+1, 10){ FOR(k, j+1, 10){ FOR(l, k+1, 10){ Q.push_back(i); Q.push_back(j); Q.push_back(k); Q.push_back(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; }