import sys n=int(input()) lose=[[] for i in range(n)] v=[i for i in range(n)] while len(v)>1: w=[] for i in range(0, len(v), 2): if i+1==len(v): w.append(v[i]) else: print("? %d %d" % (v[i]+1, v[i+1]+1)) sys.stdout.flush() res=int(input()) res-=1 w.append(res) if res==v[i]: lose[res].append(v[i+1]) else: lose[res].append(v[i]) v=w a=v[0] ans=lose[a][0] for i in range(1, len(lose[a])): print("? %d %d" % (lose[a][i]+1, ans+1)) sys.stdout.flush() res=int(input()) res-=1 ans=res print("! %d" % (ans+1)) sys.stdout.flush()