N=int(input()) player=[x for x in range(N)] opponent=[[] for x in range(N)] while len(player)>=2: prev=player player=[] while len(prev)>=2: x,y=prev.pop(),prev.pop() print("?",x+1,y+1) ans=int(input())-1 player.append(ans) opponent[ans].append(x^y^ans) if prev: player.append(prev.pop()) first=player[0] player=opponent[first] while len(player)>=2: prev=player player=[] while len(prev)>=2: x,y=prev.pop(),prev.pop() print("?",x+1,y+1) ans=int(input())-1 player.append(ans) if prev: player.append(prev.pop()) ans=player[0] print("!",ans+1)