def f(n): kekka = [[] for _ in range(n + 1)] member = [x for x in range(1, n + 1)] while len(member) > 1: nm = [] for a, b in zip(member[::2], member[1::2]): print("?", a, b) w = int(input()) if w == b: a, b = b, a nm.append(a) kekka[a] += [b] if len(member) % 2: nm.append(member[-1]) member = nm winner = member[0] member = kekka[winner] while len(member) > 1: nm = [] for a, b in zip(member[::2], member[1::2]): print("?", a, b) w = int(input()) if w == b: a, b = b, a nm.append(a) if len(member) % 2: nm.append(member[-1]) member = nm print("!", member[0]) n=int(input()) f(n)