program h;

{$APPTYPE CONSOLE}

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