program ph;

const infile  = 'heapsort.in';
      outfile = 'heapsort.out';
      maxn    = 500000;

var n : longint;
    a : array[1..maxn]of longint;  

procedure init;
 begin
  assign(input, infile); reset(input);
  assign(output, outfile); rewrite(output);
  read(n);
 end;

var b : array[0..200]of longint;

procedure solve;
var m, i : longint;
 begin
  m := 1;
  a[1] := 1;
  while m <> n do begin
    b[0] := 1;
    b[1] := m;
    while b[b[0]] <> 1 do begin
      b[b[0] + 1] := b[b[0]] div 2;
      b[0] := b[0] + 1;
     end;
    m := m + 1;
    a[m] := 1;
    for i := 2 to b[0] do a[b[i - 1]] := a[b[i]];
    a[1] := m;  
   end;
 end;

procedure save;
var i : longint;
 begin
  for i := 1 to n do write(a[i], ' ');
  writeln;
  close(output);
 end;

begin
 init;
 solve;
 save;
end.