I,P=input,print N=int(I()) y=0 if N==3: P("?",y,y) y=int(I()) P("!",y*2%3),exit(0) if N==5: P("?",y,1) y=int(I()) P("?",y,1) z=int(I()) P("!",1-y if y<2 else 9-y-z),exit(0) while N%2<1: P("?",y,y) y=int(I()) N//=2 x,N=y,N-1 while N: if N%2: P("?",x,y) x=int(I()) N=N//2 if N: P("?",y,y) y=int(I()) P("!",x)