def question(K): print("?",K,flush=True) S=int(input()) T[K]=S-(K-S) def answer(L,R): print("!",L,R,flush=True) exit() def General_Binary_Increase_Search_Integer(L,R,cond,default=None): """条件式が単調増加であるとき, 整数上で二部探索を行う. L: 解の下限 R: 解の上限 cond: 条件(1変数関数, 広義単調増加を満たす) default: Lで条件を満たさないときの返り値 """ #if not(cond(R)): return default #if cond(L): return L R+=1 while R-L>1: C=L+(R-L)//2 if cond(C): R=C else: L=C return R def check(x): question(x) return T[x]*T[N-1]<=0 #================================================== N=int(input()) T=[None]*(N+1) question(1); question(N-1) if T[1]==T[N-1]: answer(2,N-1) M=General_Binary_Increase_Search_Integer(2,N-1,check) if N//2<=M: answer(1,M) else: answer(M+1,N)