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