mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline def ask(x, y): print("?", x, y) sys.stdout.flush() return int(input()) N = int(input()) st = list(range(1, N+1)) op = [[] for _ in range(N+1)] while len(st) > 1: st_new = [] for i in range(len(st) // 2): x = st[i * 2] y = st[i * 2 + 1] op[x].append(y) op[y].append(x) z = ask(x, y) st_new.append(z) if len(st) & 1: st_new.append(st[-1]) st = st_new first = st[0] second_list = op[first] x = second_list[0] for y in second_list[1:]: x = ask(x, y) print("!", x) sys.stdout.flush() if __name__ == '__main__': main()