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