import java.io.*; import java.util.*; public class Main_yukicoder566 { private static Scanner sc; private static Printer pr; private static void solve() { int k = sc.nextInt(); int n = 1; for (int i = 0; i < k; i++) { n *= 2; } List ans = new ArrayList<>(n); int base = 2; for (int i = 0; i < k - 1; i++) { for (int j = 1; j < base; j += 2) { ans.add(n / base * j); } base *= 2; } for (int i = 1; i < n; i += 2) { ans.add(i); } // pr.println(ans); // pr.println(ans.size()); // pr.println(n); for (int i = 0, size = ans.size(); i < size; i++) { if (i > 0) { pr.print(' '); } pr.print(ans.get(i)); } pr.println(); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }