#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0;i ans; int main() { cin >> K; // 真ん中 + 1 をとる int root = pow_f(K - 1) + 1; ans.push_back(root); int max_num = pow_f(K) - 1; int cur = root + 2; while(cur <= max_num) { ans.push_back(cur); cur += 2; } cur = root - 2; while(cur >= 1) { ans.push_back(cur); cur -= 2; } cur = root - 1; while(cur <= max_num) { ans.push_back(cur); cur += 2; } cur = root - 3; while(cur >= 1) { ans.push_back(cur); cur -= 2; } REP(i, ans.size()) { printf("%d", ans[i]); if(i != ans.size()) { printf(" "); } else { printf("\n"); } } return 0; }