def ask(i, j): print("?", i+1, j+1, flush=True) return int(input())-1 def tournament(now): lose = [[] for _ in range(n)] while len(now) > 1: win = [] for i, j in zip(now[::2], now[1::2]): w = ask(i, j) lose[w].append(i ^ j ^ w) win.append(w) now = win return now[0], lose n = int(input()) top, lose = tournament(list(range(n))) ans, _ = tournament(lose[top]) print("!", ans+1, flush=True)