#include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; typedef vector vi; typedef pair pii; typedef vector > vpii; typedef long long ll; template static void amin(T &x, U y) { if (y < x) x = y; } template static void amax(T &x, U y) { if (x < y) x = y; } int main() { int K; while (~scanf("%d", &K)) { vector ans; function rec = [&](int L, int R) { if (L > R) return; int mid = (L + R) / 2; ans.push_back(mid); rec(L, mid - 1); rec(mid + 1, R); }; ans.push_back(1); rec(2, (1 << K) - 1); for (int i = 0; i < (int)ans.size(); ++ i) { if (i != 0) putchar(' '); printf("%d", ans[i]); } puts(""); } return 0; }