from src.data_structure.BIT import BIT n = int(input()) L = [0] * n R = [i for i in range(n)] def f(): X = [(l + r) for l, r in zip(L, R)] for i in range(n - 1): if X[i] > i: X[i] -= i + 1 X[i + 1] += 1 for i in range(n - 1, -1, -1): if X[i] % 2 == 1: X[i - 1] += i X[i] //= 2 X[0] //= 2 return X def ask(X, q="?"): P = [] bit = BIT(n) for i in range(n): bit.add(i, 1) for x in X[::-1]: p = bit.lower_bound(x + 1) - 1 P.append(p + 1) bit.add(p, -1) print(q, *P, flush=True) assert len(set(P)) == n if q == "?": return int(input()) while 1: mid = f() if mid == L: break res = ask(mid) if res == -1: exit() if res == 0: R = mid else: L = mid res = ask(R) if res == -1: exit() if res == 0: ask(R, "!") else: ask(L, "!")