K = int(input()) s = 2**(K-1)-1 t = 2**(K)-1 ans = [] def dfs(a,b): stack = [(a,b)] while len(stack) > 0: d = stack.pop() if d[0] == d[1]: ans.append(d[0]) continue m = (d[0] + d[1]) // 2 stack.append((d[0],m)) stack.append((m+1,d[1])) dfs(1,s) dfs(s+1,t) print(' '.join([str(i) for i in ans]))