N = int(input()) cand = list(range(1, N + 1)) while len(cand) > 2: nxt = [] while len(cand) >= 2: a = cand.pop() b = cand.pop() print("? {} {}".format(a, b)) ans = int(input()) nxt.append(ans) if cand: nxt.append(cand) cand = nxt a, b = cand print("? {} {}".format(a, b)) ans = int(input()) print("! {}".format(a ^ b ^ ans))