#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; int can=0; can+=floor(log2(N)*(N-1)+1e-8); can-=(N)/2; can++; vector rem(N);iota(all(rem),1); vector ans; for(int t=0;t1){ if(can==0){ shuffle(all(rem),rng); for(int x:rem){ ans.push_back(x); } cout<<"!"; for(int a:ans) cout<<" "< A=ans; A.push_back(rem[mid]); for(int i=0;i>x; if(x) left=mid; else right=mid; can--; } ans.push_back(rem[left]); rem.erase(rem.begin()+left); } ans.push_back(rem.back()); cout<<"!"; for(int a:ans) cout<<" "<