import math,sys K=int(input()) if K==2: ans=['1','3','2'] print(' '.join(ans)) sys.exit() v=2**(K-1)+1 P=[str(v)] left=[str(i) for i in range(1,v)] right=[str(i) for i in range(v+1,2**K)] tmp=K-1 while tmp!=0: if tmp==1: P+=['1'] else: P+=left[2**(tmp-1)-1:2**tmp-1] tmp-=1 right_root=right[len(right)//2] P.append(str(v-1)) P.append(right_root) right.remove(right_root) P+=right print(' '.join(P))