K = int(input()) n = 2**K a = [] ap = a.append ap(n//2+1) queue = [(n//2, 2)] qap = queue.append pop = queue.pop while queue: c, i = pop() left = c>>1 right = c+(c>>1) if left+1 < n and left+1 not in a: ap(left+1) if right+1 < n and right+1 not in a: ap(right+1) if i < K: qap((right, i+1)) qap((left, i+1)) elif 1 not in a: ap(1) print(" ".join(map(str,a)))