{$APPTYPE CONSOLE}
{$O-,Q+,R+}

uses Math, SysUtils;

type
  int = integer;
  bool = boolean;
  real = extended;
var
  a : array [1..50000] of integer;
  i, n, j : integer;
begin
  reset(input, 'heapsort.in');
  rewrite(output, 'heapsort.out');
  read(n);
  a[1] := 1;
  for j := 2 to n do
  begin
    i := j - 1;
    while i > 1 do
    begin
      a[i] := a[i div 2];
      i := i div 2;
    end;
    a[1] := j;
    a[j] := 1;
  end;
  for i := 1 to n do write(a[i], ' ');  
end.