import sys from collections import * from math import * N = int(input()) S = list(range(N)) now = 1 ansA = [0] * N ansB = [0] * N while S: temp = [0] * N g = -1 newS = [] for i in S: print("? {} {}".format(now, i + 1)) sys.stdout.flush() temp[i] = int(input()) if g == -1: g = temp[i] else: g = gcd(g, temp[i]) C = Counter(temp) for i in range(N): if C[temp[i]] == 1: ansB[i] = temp[i] // g else: if temp[i]: newS.append(i) newS, S = S, newS ind = ansB.index(1) + 1 for i in range(N): print("? {} {}".format(i + 1, ind)) sys.stdout.flush() ansA[i] = int(input()) ans = ["!"] + ansA + ansB print(*ans)