from collections import deque n = int(input()) a_list = [i for i in range(n)] d = deque(a_list) a=d.popleft() b=d.popleft() print('?',a,b) i = 0 while i <= n//2: x = int(input()) try: if x == a and x == b: if x == a: print('!',b) else: print('!',a) else: a = d.popleft() b = d.popleft() print('?',a,b) i+=1 except: print('!',n-1) break