#include using namespace std; typedef long long ll; #define REP(i,a,n) for(ll i=(a); i<(ll)(n); i++) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(v) (v).begin(), (v).end() int main(void) { int K,root,tmp,node=0,range,add; vector ans; cin >> K; range = pow(2, K); node = range/2; add = range; tmp = node; while(true) { ans.push_back(node); if (node == range - 1) break; if (node + add >= range) { tmp /= 2; add /= 2; node = tmp; } else node += add; } for (int i=0; i