#include using namespace std; int main() { int N; cin >> N; vector ANS; vector B(N, false); for (int i = 0; i < N; i++) { int ok = 0, ng = N - i; vector X; for (int j = 0; j < N; j++) { if (!B[j]) X.push_back(j); } while (ng - ok > 1) { int mid = (ok + ng) / 2; vector Q = ANS; Q.push_back(X[mid]); for (int j = 0; j < N - i; j++) { if (j != mid) Q.push_back(X[j]); } cout << "?"; for (int j = 0; j < N; j++) { cout << ' ' << Q[j] + 1; } cout << endl; int a; cin >> a; if (a == 1) ok = mid; else ng = mid; } ANS.push_back(X[ok]), B[X[ok]] = true; } cout << '!'; for (int i = 0; i < N; i++) cout << ' ' << ANS[i] + 1; cout << endl; }