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