program P_H;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i, nc, j, k, n: longint;
  c,a: array [1..100000] of integer;

begin
  assign(input, 'heapsort.in'); reset(input);
  assign(output, 'heapsort.out'); rewrite(output);
  read(n);
  a[1] := 2;
  a[2] := 1;
  for k := 3 to n do
  begin
     nc := 1;
     c[1] := k - 1;
     repeat
       c[nc + 1] := c[nc] div 2;
       nc := nc + 1;
     until c[nc] = 1;

     for j := 1 to nc - 1 do
     begin
       a[c[j]] := a[c[j+1]];
     end;

     a[1] := k;
     a[k] := 1;
  end;
  for i := 1 to n -1  do
    write(a[i], ' ');
  writeln(a[n]);
  close(input); close(output);
end.
