#!/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)] def check(v1, v2): p, q = v1 // n - v2 // n, v1 % n - v2 % n return min(p, q), max(p, q) z = {} for i in range(n, n * n): for j in range(n, n * n): if i != j: p, q = check(i, j) if (p, q) not in z: z[(p, q)] = [] z[(p, q)].append((i, j)) # print(z) for i in range(m - 1): for j in range(i + 1, m): if a[i] and a[j] and len(a[i]) == 1 and len(a[j]) == 1: continue print("? {} {}".format(i + 1, j + 1), flush=True) p, q = read_ints() t = z.get((p, q), [set(), set()]); s1, s2 = set(), set() for x, y in t: if (a[i] is None or x in a[i]) and (a[j] is None or y in a[j]): s1.add(x); s2.add(y) 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)