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