{$O-,R+,Q+}
var
 k,j,i,n:longint;
 a:array[1..50000] of longint;
begin
 assign(input,'heapsort.in'); reset(input);
 assign(output,'heapsort.out'); rewrite(output);
 read(n);
 a[1] := 1;
 for i := 2 to n do begin
   a[i] := 1;
   j := i - 1;
   while j <> 1 do begin
     k := j div 2;
     a[j] := a[k];
     j := k;
   end;
   a[1] := i;
 end;
 
 write( a[1] );
 for i := 2 to n do
   write( ' ', a[i] );
 writeln;
end.