#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; int main(){ ios::sync_with_stdio(false); int N; cin >> N; vector v; rep(i,N){ v.push_back(i+1); } int ok = 0; bool flg = true; int turn = 1; while(ok != 2){ flg = false; turn = 1 - turn; cout << "?"; for(int i=0; i> tmp; if(i+turn+1"){ swap(v[i+turn],v[i+turn+1]); flg = true; } } } if(!flg) ok++; } cout << "!"; rep(i,N){ cout << " " << v[i]; } cout << endl; return 0; }