uses
  SysUtils;
var
  a: array[1 .. 50000] of integer;
  i, j, n: integer;
begin
  assignfile(input, 'heapsort.in');
  assignfile(output, 'heapsort.out');
  reset(input);
  rewrite(output);
  read(n);
  a[1] := 1;
  for i := 2 to n do
  begin
    j := i - 1;
    while j <> 1 do
    begin
      a[j] := a[j div 2];
      j := j div 2;
    end;
    a[1] := i;
    a[i] := 1;
  end;
  for i := 1 to n do
    write(a[i], ' ');
  closefile(input);
  closefile(output);
end.
 