N = int(input()) fact = [1] * (N + 1) for i in range(1, N + 1): fact[i] = fact[i - 1] * i def lehmer(m, N): L = list(range(1, N + 1)) ret = [] for i in range(N): q = m // fact[N - 1 - i] m %= fact[N - 1 - i] ret.append(L.pop(q)) return ret def check(m): print("?", *lehmer(m, N), flush=True) return int(input()) def BinarySearch(check, yes = 10 ** 18, no = -1): while abs(yes - no) != 1: mid = (yes + no)//2 if check(mid): yes = mid else: no = mid return yes ans = BinarySearch(check, fact[N], -1) print("!", *lehmer(ans, N))