#include using namespace std; using ll = long long; int main(){ int n; cin>>n; deque que; int l = 1; int r = 2; cout<<"? 1 2"<>t; if(t==1); else swap(l,r); que.push_back(l); que.push_back(r); int ni = 3; for(;ni<=n;ni++){ int l = -1; int r = que.size(); while(r-l>1){ int mid = (r+l)/2; cout<<"? "<>op; if(op==-1) assert(false); if(op==1) l = mid; else r = mid; } if(r==0){ que.push_front(ni); continue; } if(l==que.size()-1){ que.push_back(ni); continue; } deque nxt; for(int i = 0;i<=l;i++) nxt.push_back(que[i]); nxt.push_back(ni); for(int i = r;i