N=int(input()) for i in range(N): print("?", i, i) val= int(input()) if val==i: j=(i+1)%N print("?", i,j) val2=int(input()) if val2==j: print("!",i) exit()