import sequtils,strutils
var
    K = stdin.readline.parseint
    ans = newSeq[int](0)
    que : array[10000, int]
    p : int
ans.add(1)
que[0] = (1 shl (K - 1))
p = 1
for i in 0..<((1 shl K) - 2):
    ans.add(que[i])
    if (que[i] and 1) == 1:
        continue
    for t in 1..12:
        if (que[i] and (1 shl t)) > 0:
            que[p] = que[i] + (1 shl (t - 1))
            p += 1
            que[p] = que[i] - (1 shl (t - 1))
            p += 1
            break
echo ans.join(" ")