N = int(input()) L = list(range(1, N + 1)) ans = [] def check(ans, mid, L): temp = L[mid] L1 = L[:mid] L2 = L[mid+1:] lst = ["?"] + ans + [temp] + L1 + L2 print(*lst, flush=True) flag = int(input()) return flag for i in range(N - 1): yes = 0 temp = L.pop() lst = ["?"] + ans + [temp] + L print(*lst, flush=True) flag = int(input()) if flag: ans.append(temp) continue L.append(temp) no = len(L) - 1 while no - yes != 1: mid = (yes + no)//2 if check(ans, mid, L): yes = mid else: no = mid v = L.pop(yes) ans.append(v) ans = ["!"] + ans + L print(*ans)