{$APPTYPE CONSOLE}
program zzz;

var
  a: array[1..50000] of Longint;
  i,j,k,n,m: Longint;

procedure swap(var a,b: Longint);
var i: Longint;
begin
  i := a;
  a := b;
  b := i;
end;

procedure pushup(el: Longint);
var pel: Longint;
begin
  while el <> 1 do begin
    pel := el;
    el := el div 2;
    swap(a[pel],a[el]);
  end;
end;

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
    pushup(i-1);
    a[i] := i;
    swap(a[1],a[i]);
  end;
  for i := 1 to n do begin
    write(a[i],' ');
  end;
  writeln;
  close(input);
  close(output);
end.