#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N; vector rem(N);iota(all(rem),1); vector ans; for(int t=0;t1){ int mid=(left+right)/2; vector A=ans; A.push_back(rem[mid]); for(int i=0;i>x; if(x) left=mid; else right=mid; } ans.push_back(rem[left]); rem.erase(rem.begin()+left); } ans.push_back(rem.back()); cout<<"!"; for(int a:ans) cout<<" "<