import math n = int(input()) for a in range[2, 1000]: g = math.gcd(a, n) if g > 1: print("!", g, n // g) exit(0) print("?", a) r = int(input()) if r % 2 == 1: continue pow_a = pow(a, r // 2, mod=n) if pow_a == n - 1: continue p = math.gcd(pow_a + 1, n) q = math.gcd(pow_a - 1, n) if p * q == n: print("!", p, q) break