program xx;
const inp='heapsort.in';
     outp='heapsort.out';
var n,i,j,k:longint;
    a:array[1..1000000]of longint;
begin
 assign(input,inp); reset(input);
 assign(output,outp); rewrite(output);
 read(n);
 a[1]:=1;
 for i:=2 to n do
  begin
   k:=i-1;
   while k<>1 do
    begin
     j:=a[k];
     a[k]:=a[k div 2];
     a[k div 2]:=j;
     k:=k div 2;
    end;
   a[1]:=i;
   a[i]:=1;
  end;
 for i:=1 to n-1 do write(a[i],' ');
 writeln(a[n]);
 close(input); close(output);
end.
