#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0;i<(n);i++) int N; struct Node{ int p,q; int val()const{return p*N+q;} Node operator+(Node r)const{return {p+r.p,q+r.q};} Node operator-(Node r)const{return {p-r.p,q-r.q};} bool operator<(Node r)const{return val()x.q) swap(x.p,x.q); return x; } const int sign_offset=100; int main(){ cin>>N; int NN=N*N-N; Node R[2500]; R[0]={0,0}; for(int i=2; i<=NN; i++){ cout<<"? "<>R[i-1].p>>R[i-1].q; } int C[sign_offset*2]={}; rep(i,NN){ C[R[i].p+sign_offset]++; C[R[i].q+sign_offset]++; } Node ans1={-1,-1}; rep(i,sign_offset*2-1){ int prev = C[i]; if(prev+N <= C[i+1]){ ans1.p = -(i-sign_offset); prev+=N; } if(prev+N-1 <= C[i+1]){ ans1.q = -(i-sign_offset)-1; prev+=N-1; } } Node corner_val= {1,N-1}; if(ans1.q > N-1-ans1.q) corner_val={N-1,0}; int corner_p = -1; rep(i,NN) if(f(corner_val,ans1)==R[i]) corner_p=i; Node ans[2500]; rep(i,NN) ans[i]={-1,-1}; Node min_box = Node{1,0}-ans1; Node max_box = Node{N-1,N-1}-ans1; rep(i,NN){ if(ans[i].p!=-1) continue; if(R[i].p==R[i].q){ ans[i]=ans1+R[i]; continue; } if(R[i].pmax_box.p || R[i].q>max_box.q){ swap(R[i].p,R[i].q); ans[i]=R[i]+ans1; continue; } if(R[i].qmax_box.p || R[i].p>max_box.q){ ans[i]=R[i]+ans1; continue; } int rev=i+1; for(; rev>res.p>>res.q; if(corner_val.q!=0) swap(res.p,res.q); ans[i]=res+corner_val; Node revres = ans[i]-ans1; swap(revres.p,revres.q); revres=revres+ans1; ans[rev]=revres; } cout<<"!"; rep(i,NN) cout<<" "<