#include "bits/stdc++.h" using namespace std; using ll = long long; using IP = pair; #define INF 999999999 #define atcoder(int)1e9+7 #define Endl endl #define all(v) (v.begin(),v.end()) #define pb(a) push_back(a) vector v; void tree(int l, int r) { if (l == 1 && r == 3) { v.pb(1); v.pb(2); v.pb(3); return; } if (l == r) { v.pb(l); return; } int md = (l + r) / 2; v.pb(md); tree(l, md-1); tree(md+1, r); } int main() { int k; cin >> k; int n =1; for (int i = 0; i < k; i++)n *= 2; n--; tree(1, n); for (int i = 0; i < v.size(); i++) { if (i)cout << ' '; cout << v[i]; } cout << endl; return 0; }