program th;

{$APPTYPE CONSOLE}
{$R+,Q+,S+,H+}
{$MINSTACKSIZE 4000000}

uses
  Math,
  SysUtils;

Type
  Integer=LongInt;
  Real=Extended;

Const
  TaskID='heapsort';
  InFile=TaskID+'.in';
  OutFile=TaskID+'.out';
  MaxN=50002;

Var
  N:Integer;
  H,Res:Array[1..MaxN]Of Integer;

Procedure Load;
Begin
  ReSet(Input,InFile);
  Read(N);
  Close(Input);
End;

Procedure Up(A:Integer);
Var
  T:Integer;
Begin
  If A=1 Then Exit;
  Up(A Div 2);
  T:=H[A Div 2];
  H[A Div 2]:=H[A];
  H[A]:=T;
End;

Procedure Solve;
Var
  I,T:Integer;
Begin
  For I:=1 To N Do H[I]:=I;
  For I:=N DownTo 1 Do Begin
    Res[H[1]]:=I;
    T:=H[1];
    H[1]:=H[I];
    H[I]:=T;
    If I>1 Then
      Up(I-1);    
  End;
End;

Procedure Save;
Var
  I:Integer;
Begin
  ReWrite(Output,OutFile);
  Close(Output);
  For I:=1 To N Do Begin
    If I>1 Then Write(' ');
    Write(Res[I]);
  End;
  WriteLn;
End;

begin
  Load;
  Solve;
  Save;
end.
 