def Eratosthenes(N): is_prime = [1 for i in range(N+1)] is_prime[0] = is_prime[1] = 0 P = [] for p in range(2,N+1): if is_prime[p] == 0: continue P.append(p) for d in range(2,N//p+1): q = p*d is_prime[q] = 0 return P def ques(y): print('?',y) N = int(input()) P = Eratosthenes(N) D = [0 for i in range(len(P))] for i in range(len(P)): p = P[i] for d in range(1,20): n = pow(p,d) if n > N: break ques(n) z = int(input()) if n == z: D[i] = d else: break ans = 1 for i in range(len(P)): p,d = P[i],D[i] ans *= pow(p,d) print(ans)