#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)<> x >> y; if(x==4) exit(0); return x+y; } int main(){ cin.tie(0); ios::sync_with_stdio(false); set se; { vector xy(10); FOR(i, 3, 10){ ll v = query(0, 1, 2, i); xy[i] = v; } ll ma = *max_element(ALL(xy)); for(int i=0; i<10; i++){ if(xy[i]==ma) se.insert(i); } } { vector xy(10); FOR(i, 0, 7){ ll v = query(9, 8, 7, i); xy[i] = v; } ll ma = *max_element(ALL(xy)); for(int i=0; i<10; i++){ if(xy[i]==ma) se.insert(i); } } vector Q; for(ll a : se){ Q.push_back(a); } do{ query(Q[0], Q[1], Q[2], Q[3]); } while (next_permutation(ALL(Q))); return 0; }