const maxn=50000;
var j,cnt,i,n:longint;
    a:array[1..maxn]of longint;

procedure swap(i,j:longint);
var c:longint;
begin
  c:=a[i];
  a[i]:=a[j];
  a[j]:=c;
end;

begin
  assign(input,'heapsort.in');
  reset(input);
  assign(output,'heapsort.out');
  rewrite(output);

  read(n);
  a[1]:=1;
  cnt:=0;
  for i:=2 to n do
    begin
      j:=i-1;
      while (j>1) do
        begin
          inc(cnt);
          swap(j,j div 2);
          j:=j div 2;
        end;
      a[i]:=a[1];
      a[1]:=i;
    end;

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

  close(input);
  close(output);
end.