N = int(input()) import sys if N % 2 == 1: s = set() count = 0 for i in range(N): if count == N // 2:break if i not in s: print("?",i,i) a = int(input()) if a == i: print("!",a) exit() else: s.add(a) s.add(i) for i in range(N): if i not in s: print("!",i) exit() else: print("? 0 0") a = int(input()) now = a for _ in range(N // 2 - 1): print("?",a,now) now = int(input()) print("!",now)