#include #include #include #include #include #include #define rep(i,n) for(int i = 0;i < n;i++) #define REP(i,n,k) for(int i = n;i < k;i++) #define P(p) cout << (p) << endl;//print typedef long long ll; using namespace std; vector f(int k){ if(k==2){ vectora = {3,1,2}; return a; } int sa = 1; rep(i,k-1){ sa *= 2; } int top = sa*2-1; sa--; vector ans; vector mae = f(k-1); ans.push_back(top); rep(i,mae.size()){ ans.push_back(mae[i]+sa); } rep(i,mae.size()){ ans.push_back(mae[i]); } return ans; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int k; cin >> k; vectorans=f(k); rep(i,ans.size()-1){ cout << ans[i] << " "; } cout << ans.back() << endl; }