#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define int long long #define MOD7 1000000007 #define MOD9 1000000009 #define rep(i, n) for (int i = 0; i < (n); i++) #define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++) #define REP(i, a, n) for (int i = (a); i <= (n); i++) #define all(a) (a).begin(), (a).end() using namespace std; int dx[4] = { 1, 0, -1, 0 }; int dy[4] = { 0, -1, 0, 1 }; template void inputVector(vector& v, int n) { v.resize(n); for (int i = 0; i < v.size(); i++) cin >> v[i]; } void dfs(vector &ret, int minV, int maxV) { if (minV > maxV) return; int val = (minV + maxV) / 2; ret.push_back(val); dfs(ret, minV, val - 1); dfs(ret, val + 1, maxV); } signed main() { int K; cin >> K; int N = pow(2, K) + 0.0000001 - 1; vector ret; int first = min(N, 3 * K); for (int i = first; i >= 1; i--) ret.push_back(i); dfs(ret, first + 1, N); rep(i, N) { cout << ret[i] << ' '; } cout << endl; return 0; }