import sys sys.setrecursionlimit(100000000) def f(l, r): if l == 1 and r == 3: ans.append('1') ans.append('2') ans.append('3') return if l == r: ans.append(str(l)) return m = (l + r) // 2 ans.append(str(m)) f(l, m - 1) f(m + 1, r) k = int(input()) ans = [] f(1, 2 ** k - 1) print(" ".join(ans))