def guess(i, j): print("?", i + 1, j + 1, flush=True) return int(input()) n = int(input()) if n == 1: print("!", 1, 1, flush=True) exit() p = n while True: ok = True d = 2 while d * d <= p: if p % d == 0: ok = False break d += (d & 1) + 1 if ok: break x, y = -1, -1 for i in range(n): if guess(i, i) % p == 0: if x == -1: x = i else: y = i if y != -1 and guess(x, y) % p != 0: x, y = y, x a = [] for i in range(n): a.append(p if i == x else guess(i, y) // p) b = [] for j in range(n): b.append(p if j == y else guess(x, j) // p) print("!", " ".join(map(str, a)), " ".join(map(str, b)), flush=True)