#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i> n; int m=n; n=n*n-n; int a, b; vector

p(n), ans(n,{-1,-1}); map mp; vector

same; int mx=-1, mn=2*n; int mxp, mnp; REP(i,n){ cout << "? " << i+1 << " " << 1 << endl; cin >> a >> b; p[i]={a,b}; if(mp[p[i]]!=0) same.push_back({mp[p[i]]-1,i}); else mp[p[i]]=i+1; if(a+b>mx){ mx=a+b; mxp=i; } if(a+b> a >> b; P c1={ox+p[s.first].first,oy+p[s.first].second}; P c2={ox+p[s.first].second,oy+p[s.first].first}; if(c1==P{a,b+1}||c1==P{b,a+1}){ ans[s.first]=c1; ans[s.second]=c2; } else{ ans[s.first]=c2; ans[s.second]=c1; } } } else{ for(P s:same){ cout << "? " << mxp+1 << " " << s.first+1 << endl; cin >> a >> b; P c1={ox+p[s.first].first,oy+p[s.first].second}; P c2={ox+p[s.first].second,oy+p[s.first].first}; if(c1==P{m-1-a,m-1-b}){ ans[s.first]=c1; ans[s.second]=c2; } else{ ans[s.first]=c2; ans[s.second]=c1; } } } cout << "! "; REP(i,n){ if(ans[i]==P{-1,-1}){ P c1={ox+p[i].first,oy+p[i].second}; if(c1.first>=0&&c1.first=1&&c1.second