{$R+,Q+,O-}
{$MINSTACKSIZE $00404000}
{$APPTYPE CONSOLE}
type
  int = longint;

var
  h: array [0..100000] of int;
  n, u, i: int;
  
begin
  assign(input, 'heapsort.in');
  assign(output, 'heapsort.out');
  reset(input);
  rewrite(output);

  read(n);
  h[1]:=1;
  for i:=2 to n do
  begin
    h[0]:=i;
    u:=i - 1;
    while (u > 0) do
    begin
      h[u]:=h[u shr 1];
      u:=u shr 1;
    end;
    h[i]:=1;
  end;

  for i:=1 to n do
    write(h[i], ' ');

  writeln;
end.

