{$APPTYPE CONSOLE}
var
  i,j,n,k:longint;
  a:array[1..1000000]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
    k:=i-1;
    while k>1 do begin
      a[k]:=a[k div 2];
      k:=k div 2;
    end;
    a[1]:=i;
    a[i]:=1;
  end;
  for j:=1 to n do write(a[j],' ');
end.
 