{Q+,R+,I+,S+}
{$APPTYPE CONSOLE}
var
  i,j,k,n: longint;
  a: array [1..50010] of longint;
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
    a[i]:=1;
    k:=i-1;
    while k>1 do
    begin
      a[k]:=a[k shr 1];
      k:=k shr 1;
    end;
    a[1]:=i;
  end;
  write(a[1]);
  for i:=2 to n do write(' ',a[i]);
  writeln;
  close(input); close(output);
end.
 