from math import * n = int(input()) f = [1] for i in range(n): f.append(f[-1] * (i + 1)) l, r = 0, f[n] - 1 q = [0] * n while l + 1 < r: m = (l + r) // 2 t = m s = list(range(1, n + 1)) for i in range(n): q[i], t = s.pop(t // f[n - i - 1]), t % f[n - i - 1] print("?", *q) if input() > '0': l = m else: r = m print('!', *q)