# coding: utf-8 # Your code here! import sys sys.setrecursionlimit(10**6) readline = sys.stdin.readline #文字列入力のときは注意 n=int(input()) cand = [[i] for i in range(1,n+1)] while len(cand) > 1: cand2 = [] while len(cand) > 1: a = cand.pop() b = cand.pop() print("?", a[0], b[0]) sys.stdout.flush() res = int(input()) if res == a[0]: a.append(b[0]) cand2.append(a) else: b.append(a[0]) cand2.append(b) if cand: cand2.append(cand[0]) cand = cand2 cand = cand[0] cand.pop(0) ans = cand.pop() while cand: c = cand.pop() print("?", ans, c) sys.stdout.flush() res = int(input()) if res == c: ans = c print("!", ans)