import math;G=math.gcd;a=g=2;n=int(input()) while g<3:print("?",a);g=max(G(n,pow(a,int(input())>>1,n)-1),G(a:=a+1,n)) print("!",g,n//g)