import math,sys K=int(input()) 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)] def f(list): if len(list)==0: return [] elif len(list)==1: return [list[0]] else: index=len(list)//2 return [list[index],list[0:index],list[index+1:]] que=[left,right] while len(P)!=2**K-1: if len(que)<=1: print('error') else: l=que.pop(0) r=que.pop(0) tmp1=f(l) tmp2=f(r) if len(tmp1)==3: v1,l1,r1=tmp1[0],tmp1[1],tmp1[2] P.append(str(v1)) que.append(l1) que.append(r1) if len(tmp2)==3: v2,l2,r2=tmp2[0],tmp2[1],tmp2[2] P.append(str(v2)) que.append(l2) que.append(r2) if len(tmp1)==1: P.append(str(tmp1[0])) if len(tmp2)==1: P.append(str(tmp2[0])) print(' '.join(P))