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