import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int length = (int)(Math.pow(2, n)) - 1; ArrayList list = new ArrayList<>(); make(1, length, list); StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { int x = list.get(i); if (x == length) { continue; } sb.append(x + 1).append(" "); } sb.append(1); System.out.println(sb); } static void make(int left, int right, ArrayList list) { if (left == right) { list.add(left); return; } int mid = (left + right) / 2; list.add(mid); make(left, mid - 1, list); make(mid + 1, right, list); } }