#!/usr/bin/env python3 # # No.1306 Exactly 2 Digits # import sys, os, math def read_int(): return int(input()) def read_ints(): return list(map(int, input().split())) n = read_int() m = n * n - n a = [None for _ in range(m)] z = {} for i in range(n, n * n): for j in range(n, n * n): if i != j: p, q = i // n - j // n, i % n - j % n if p > q: p, q = q, p if (p, q) not in z: z[(p, q)] = [] z[(p, q)].append((i, j)) # print(z) d = {} i = 0 for j in range(i + 1, m): print("? {} {}".format(i + 1, j + 1), flush=True) p, q = read_ints() s1, s2 = set(), set() for x, y in z[(p, q)]: if (not a[i] or x in a[i]) and (not a[j] or y in a[j]): s1.add(x); s2.add(y) a[i] = s1; a[j] = s2 if len(a[i]) == 1: d[list(a[i])[0]] = i if len(a[j]) == 1: d[list(a[j])[0]] = j # print(a[i], a[j], d, file=sys.stderr) t = [] for i, s in enumerate(a): if len(s) > 1: for x in list(s): if x in d: s.remove(x) if len(s) == 1: d[list(s)[0]] = i if len(s) > 1: t.append(i) while len(t) > 0: j = t.pop() for k, i in d.items(): if i == 0: continue print("? {} {}".format(i + 1, j + 1), flush=True) p, q = read_ints() s = set() for x, y in z[(p, q)]: if (not a[i] or x in a[i]) and (not a[j] or y in a[j]): s.add(y) a[j] = s # print(a[i], a[j], file=sys.stderr) if len(a[j]) == 1: break if len(a[j]) == 1: d[list(a[j])[0]] = j else: t.append(j) print("! {}".format(" ".join([str(list(x)[0]) for x in a])), flush=True)