const
  InFile  = 'heapsort.in';
  OutFile = 'heapsort.out';

  MaxN = 100000;
  
var
  inf, outf : textfile;
  a         : array[1..MaxN] of integer;
  

procedure Init;
begin
  Assign(inf, InFile);
  Assign(outf, OutFile);
  Reset(inf);
  Rewrite(outf);
end;

procedure Run;
var
  n       : integer;
  i, j, k : integer;
  t       : integer;
begin
  Readln(inf, n);
  for i := 1 to n do
    a[i] := i;

  for i := 2 to n do
  begin
    t := a[1];
    a[1] := a[i];
    a[i] := t;
    if i = n then Break;
    j := i;
    while j > 1 do
    begin
      k := j div 2;
      t := a[k];
      a[k] := a[j];
      a[j] := t;
      j := k;
    end;
  end;

  for i := 1 to n do
    Write(outf, a[i], ' ');
end;

procedure Done;
begin
  Close(inf);
  Close(outf);
end;


begin
  Init;
  Run;
  Done;
  Halt(0);
end.