K = int(input()) a = [] append = a.append def climb(a): if not a: return mid = len(a)//2 append(a[mid]) if a[mid] == 2: append(1) return climb(a[:mid]) climb(a[mid+1:]) climb(tuple(range(2, 2**K))) print(" ".join(map(str, a)))