N = int(input()) if N == 1: print('!', 1, 1) exit() import math def is_prime(n): sqrt_n = math.ceil(math.sqrt(n)) for i in range(2, sqrt_n): if n % i == 0: return False return True P = -1 for i in range(N, -1, -1): if is_prime(i) : P = i break def query(i, j): print("?", i, j) z = int(input()) return z A = [-1] * (N + 1) B = [-1] * (N + 1) p_idx = [] for i in range(1, N + 1): z = query(i, i) if z % P == 0: p_idx.append(i) x = y = -1 # A[x] = B[y] = P if p_idx == 1: x = y = p_idx[0] else: z = query(p_idx[0], p_idx[1]) if z % P == 0: x = p_idx[0] y = p_idx[1] else: y = p_idx[0] x = p_idx[1] A[x] = B[y] = P # A[i], B[y] for i in range(1, N + 1): if i == x : continue z = query(i, y) A[i] = z // P # A[x], B[i] for i in range(1, N + 1): if i == y : continue z = query(x, i) B[i] = z // P print("!", *A[1:], *B[1:])