n=int(input()) rui=1 for i in range(1,10): rui*=2 if rui>=n: break kekka=[[-1]*i for _ in range(n+1)] #print(kekka) member=[x for x in range(1,n+1)] i=0 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][i]=b if len(member)%2: nm.append(member[-1]) member=nm i+=1 #print(kekka) #print(member) 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 i+=1 print("!",member[0])