import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n = int(input()) import sys def query(i,j): print("? {0} {1}".format(i, j)) sys.stdout.flush() return tuple(map(int, input().split())) m = n*n-n ts = [query(1,i) for i in range(2,m+1)] from collections import defaultdict c = defaultdict(int) for t in ts: c[t[0]] += 1 c[t[1]] += 1 kv = list(c.items()) kv.sort() if kv[0][1]==n-1: val = kv[0][0] y = kv[0][0] + n - 1 for item in kv: if item[1] not in (2*n-1, 2*n-3): continue x = item[0] + n - 1 else: val = kv[-1][0] assert kv[-1][1]==n-1 y = kv[-1][0] for item in kv[::-1]: if item[1] not in (2*n-1, 2*n-3): continue x = item[0] + 1 # done = [[False]*n for _ in range(n)] # done[x][y] = True ans = [None]*m ans[0] = (x,y) xy2i = defaultdict(list) for i,t in enumerate(ts): xy2i[t[0],t[1]].append(i) if val in t: if t[0]==val: t = (t[1], t[0]) ans[i+1] = (x-t[0], y-t[1]) if x-t[0]==n-1 and y-t[1]==0: index = i large = True elif x-t[0]==1 and y-t[1]==n-1: index = i large = False for i,t in enumerate(ts): if ans[i+1] is None: tt = query(index+2, i+1) if large: tt = (tt[1],tt[0]) ans[i+1] = (n-1-tt[0], -tt[1]) else: ans[i+1] = (1-tt[0], n-1-tt[1]) xx,yy = x - ans[i+1][0], y - ans[i+1][1] if xx<=yy: for ii in xy2i[xx,yy]: if i==ii: continue ans[ii+1] = (x-yy, y-xx) else: for ii in xy2i[yy,xx]: if i==ii: continue ans[ii+1] = (x-xx, y-yy) print("! "+ " ".join(map(str, [item[0]*n+item[1] for item in ans])))