from collections import defaultdict # aa = [12, 13, 11, 6, 15, 5, 7, 9, 14, 10, 8, 4] # aa = [8, 14, 7, 12, 13, 4, 15, 11, 5, 9, 6, 10] # def ask(i, j): # a = aa[i]//n-aa[j]//n # b = aa[i]%n-aa[j]%n # return min(a, b), max(a, b) def ask(i, j): print("?", i+1, j+1, flush=True) p, q = map(int, input().split()) return p, q n = int(input()) m = n**2-n pqi = defaultdict(list) for i in range(m-1): p, q = ask(i, m-1) pqi[p, q].append(i) # print(pqi) ans = [0]*m (p0, q0), mni = min(pqi.items(), key=lambda x: sum(x[0])) (p1, q1), mxi = max(pqi.items(), key=lambda x: sum(x[0])) # print(p0, q0, mni) # print(p1, q1, mxi) if len(mxi) == 2: a = 1 b = 0 ans[mxi[0]] = n**2-1 elif len(mni) == 2: a = n-1 b = n-1 ans[mni[0]] = n else: can = [(n-1-p1, n-1-q1), (n-1-q1, n-1-p1)] if (1-p0, -q0) in can: a, b = 1-p0, -q0 else: a, b = 1-q0, -p0 ans[mxi[0]] = n**2-1 ans[mni[0]] = n ans[-1] = a*n+b # print(ans) for (p, q), ii in pqi.items(): if len(ii) == 1: i = ii[0] if ans[i]: continue x0, y0 = a+p, b+q x1, y1 = a+q, b+p if 1 <= x0 < n and 0 <= y0 < n: ans[i] = x0*n+y0 else: ans[i] = x1*n+y1 (p2, q2), [ci] = max(pqi.items(), key=lambda x: x[0][1]-x[0][0]) # print(p2, q2, ci) a, b = divmod(ans[ci], n) for i in range(m): if ans[i]: continue p, q = ask(i, ci) x0, y0 = a+p, b+q x1, y1 = a+q, b+p if 1 <= x0 < n and 0 <= y0 < n: ans[i] = x0*n+y0 else: ans[i] = x1*n+y1 print("!", end=" ") print(*ans)