package yukicoder; import java.util.Scanner; public class N566 { static int[] h; static int K; public static void main(String[] args) { Scanner sc=new Scanner (System.in); K=sc.nextInt(); int p=(int)Math.pow(2, K); h=new int[p-1]; h[0]=p/2; tree(p/2,0,1); for(int ans:h) { System.out.print(ans+" "); } } static void tree(int p,int k,int rank) { h[k]=p; //if((int)Math.pow(2, K-1)-1<=k||k<=(int)Math.pow(2,K)-2) if(rank==K) { return; } else { rank++; tree(p-(int)Math.pow(2, K-rank),2*k+1,rank); tree(p+(int)Math.pow(2,K-rank),2*k+2,rank); } } }