{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$MAXSTACKSIZE $3C00000}
{$APPTYPE CONSOLE}
type
 int = integer;
 real = extended;

var
 n, i : int;
 a: array[0..100000] of int;
 l,j,x: int;
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] := i;
    l := i-1;
    j := l shr 1;
    While (j >= 1)and(a[l] < a[j]) do
     begin
       x := a[l];
       a[l] := a[j];
       a[j] := x;
       l := j;
       j := l shr 1;
     end;
    x := a[1];
    a[1] := a[i];
    a[i] := x;
  end;
For i := 1 to n do
  begin
    Write(a[i]);
    If i < n Then Write(' ');
  end;

end.
