{$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}
program h;

{$APPTYPE CONSOLE}

Var I,J,K,L,N,M:Longint;
    A,B:Array[0..60000] Of Longint;

Procedure Rec(J:Longint);
 Var I,K:Longint;
Begin
  If J<=1 Then
   Exit;
  K:=J;
  I:=J SHR 1;
  Rec(I);
  A[I]:=A[K];
End;

begin
  Assign(input,'heapsort.in');
  Reset(input);
  Assign(output,'heapsort.out');
  ReWrite(output);
   ReadLn(N);
   FillChar(A,SizeOf(A),0);
   For I:=1 To N Do
    A[I]:=I;
   B[1]:=N;
   For I:=N-1 DownTo 2 Do
    Begin
      Rec(I);
      A[K]:=1;
      B[A[1]]:=I;
    End;
   B[N]:=1;
   For I:=1 To N Do
    Write(B[I],' ');  
  Close(input);
  Close(output);
end.
