program h;

{$APPTYPE CONSOLE}

const fname = 'heapsort';
      ifile = fname + '.in';
      ofile = fname + '.out';
      MAXN = 50010;

var n: longint;
    mas: array[1..MAXN]of longint;

procedure load();
begin
  read(n);
end;

procedure solve();
var k,l: longint;
begin
  for k:=1 to n do begin
    l:=k-1;
    while l>1 do begin
      mas[l]:=mas[l shr 1];
      l:=l shr 1;
    end;
    mas[1]:=k;
    mas[k]:=1;
  end;
end;

procedure save();
var k: longint;
begin
  for k:=1 to n-1 do
    write(mas[k],' ');
  writeln(mas[n]);
end;

begin
  assign(input,ifile);
  reset(input);
  assign(output,ofile);
  rewrite(output);
  load;
  solve;
  save;
end.
 