program h;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var F : Text;
    i, N : integer;
    A : Array[1..50000] of Word;

begin
  Assign(F, 'heapsort.in');
  Reset(F);
  ReadLn(F, N);
  Close(F);

if (n mod 2) = 0 then begin
  A[1] := N;
  A[N] := 1;
 if N >= 5 then begin
  A[2] := N-1;
  A[N-1] := N-2;
  For i := 3 to ((N) div 2) do begin
    A[i] := A[i-1]-2;
    A[N-i+1] := A[N-i+2]-2;
  End;
  if (N mod 2) <> 0 then begin
    A[n div 2 + 1] := 2;
  end;
 end
 else begin
   case N of
     3: begin
          A[2] := 2;
        end;
     4: begin
          A[2] := 3;
          A[3] := 2;
        end;
   end;
 end;
end
else begin
  For i := 0 to pred(N) do begin
    A[succ(i)] := N-i;
  End;
end;
  Assign(F, 'heapsort.out');
  ReWrite(F);
  For i := 1 to N-1 do begin
    Write(F, A[i],' ');
  End;
  Write(F, A[N]);
  Close(F);
end.
