#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { string ans = ""; int K; cin >> K; int N = pow(2,K)-1; for ( int i = N/2; i >= 1; i -= 2 ) { ans += to_string(i) + " "; } for ( int i = N/2+2; i <= N; i += 2 ) { ans += to_string(i) + " "; } for ( int i = N/2-1; i >= 1; i -= 2 ) { ans += to_string(i) + " "; } for ( int i = N/2+1; i <= N; i += 2 ) { ans += to_string(i) + " "; } cout << ans.erase( ans.length()-1, 1 ) << endl; return 0; }