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