from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def main(): K = int(input()) vmax = 2 ** K -1 v0 = vmax // 2 ans = [] for i in range(v0, 0, -1): ans.append(i) for i in range(v0 + 1, vmax + 1): ans.append(i) print(ans) main()