import sys def input(): return sys.stdin.readline().strip() def mapint(): return list(map(int, input().split())) sys.setrecursionlimit(10**9) N = int(input()) from collections import defaultdict remains = list(range(1, N+1)) lost_by = defaultdict(list) def f(remains): while(len(remains)!=1): nx_remains = [] if(len(remains)%2==1): nx_remains.append(remains[-1]) for i in range(0, len(remains)-1, 2): a = remains[i] b = remains[i+1] print(f"? {a} {b}", flush=True) ret = int(input()) if(ret==a): nx_remains.append(a) lost_by[a].append(b) else: nx_remains.append(b) lost_by[b].append(a) remains = nx_remains return remains[0] first = f(remains) print(f"! {f(lost_by[first])}")