I,P=input,print S={i for i in range(int(I()))} G=S.pop while len(S)>1: x,y=G(),G() P("?",x,y) z=int(I()) if x==z:P("!",y),exit(0) if y==z:P("!",x),exit(0) P("!",G())