n = int(input()) v = 1 fact = [1] * (n + 1) for i in range(n): fact[i + 1] = fact[i] * (i + 1) def make(mid): tmp = [0] * n used = [False] * n cur = mid for i in range(n): for j in range(n): if used[j]: continue if cur - fact[n - 1 - i] < 0: tmp[i] = j + 1 break cur -= fact[n - 1 - i] used[tmp[i] - 1] = True return tmp ok, ng = 0, fact[n] while ok + 1 < ng: mid = (ok + ng) // 2 print("?", *make(mid), flush=True) if input() == "1": ok = mid else: ng = mid print("!", *make(ok), flush=True)