#include #include using namespace std; vector A; int x; void solve(int a,int b){ if(x != a+1)A.push_back(a+1); if(b!=1){ solve(a-b/2,b/2); solve(a+b/2,b/2); } } int main(){ int n;cin>>n; x = (1<<(n-1)); solve((1<<(n-2)),(1<<(n-2))); for(int i = 0; A.size() > i; i++){ cout << A[i] << " "; } cout << 1 << endl; }