from math import lcm, gcd import random def main(): N = int(input()) A = [-1 for _ in range(N)] B = [-1 for _ in range(N)] b_lcm_azero = [] r = random.randint(0, N - 1) for i in range(N): print("? {} {}".format(r + 1, i + 1), flush=True) x = int(input()) b_lcm_azero.append(x) a_r = min(b_lcm_azero) A[r] = a_r b_one_cand = [] for i in range(N): if b_lcm_azero[i] == a_r: b_one_cand.append(i) for i in range(N): values = [] for c in b_one_cand: print("? {} {}".format(i + 1, c + 1), flush=True) x = int(input()) values.append(x) b_one_cand_nxt = [] m = min(values) A[i] = m for j in range(len(b_one_cand)): if values[j] == m: b_one_cand_nxt.append(b_one_cand[j]) b_one_cand = b_one_cand_nxt if len(b_one_cand) == 1: break j = b_one_cand[0] B[j] = 1 for i in range(N): if A[i] != -1: continue print("? {} {}".format(i + 1, j + 1), flush=True) x = int(input()) A[i] = x j = -1 for i in range(N): if A[i] == 1: j = i for i in range(N): if B[i] != -1: continue print("? {} {}".format(j + 1, i + 1), flush=True) x = int(input()) B[i] = x print("!", *A, *B, flush=True) main()