import random import sys from math import gcd input = sys.stdin.readline done = set() n = int(input()) p, q = 1, 1 while True: x = random.randint(1, n-1) if x in done: continue done.add(x) if gcd(x, n) > 1: print(f'! {p} {q}') exit(0) print(f'? {x}') r = int(input()) if r % 2: continue if pow(x, r//2, n) == n-1: continue p1, p2 = gcd(pow(x, r//2, n)+1, n), gcd(pow(x, r//2, n)-1, n) q1, q2 = n//p1, n//p2 if p1*q1 == n: print(f'! {p1} {q1}') break elif p2*q2 == n: print(f'! {p1} {q1}') break