{$APPTYPE CONSOLE}

uses SysUtils;

var NN,n,i:integer;
    A:array[1..50000+100] of integer;

begin
 reset(input,'heapsort.in');
 rewrite(output,'heapsort.out');
 read(NN);

 A[1]:=1;

 for n:=2 to NN do
  begin
   i:=n-1;
   while i<>1 do begin A[i]:=A[i shr 1]; i:=i shr 1; end;
   A[1]:=n;
   A[n]:=1;
  end;

 for i:=1 to NN do
  write(A[i],' ');
 writeln; 
end.
