program heapsort;

{$APPTYPE CONSOLE}

var
	a : array[1..50000] of longint;
   i, index_of_1, n : longint;
   
procedure swap (i, j : longint);
var
	buf : longint;
begin
	buf := a[i];
   a[i] := a[j];
   a[j] := buf;
end;

begin
	assign (input, 'heapsort.in'); reset (input);
   assign (output, 'heapsort.out'); rewrite (output);
   readln (n);
	for i := 1 to n do a[i] := i;
   index_of_1 := 1;
   for i := 1 to n do begin
   	while index_of_1 <> 1 do begin
      	swap (index_of_1, index_of_1 div 2);
         index_of_1 := index_of_1 div 2;
      end;
      swap(i, index_of_1);
      index_of_1 := i;
   end;
   for i := 1 to n do
   	write (a[i], ' ');
end.
 