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