#!/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 = [set(range(n, n * n)) for _ in range(n * n - n)] def check(v1, v2): p, q = v1 // n - v2 // n, v1 % n - v2 % n return min(p, q), max(p, q) for i in range(m): for j in range(i + 1, m): if len(a[i]) <= 1 and len(a[j]) <= 1: continue ai, aj = n, j + n print("? {} {}".format(i + 1, j + 1), flush=True) p, q = read_ints() s1, s2 = set(), set() for v1 in a[i]: for v2 in a[j]: if v1 == v2: continue pp, qq = check(v1, v2) if pp == p and qq == q: s1.add(v1); s2.add(v2) a[i] = s1; a[j] = s2 # print(a[i], a[j], file=sys.stderr) print("! {}".format(" ".join([str(list(x)[0]) for x in a])), flush=True)