{$APPTYPE CONSOLE}
const maxn=50002;
var p:array[1..maxn] of longint;
    n:longint;

procedure readdata;
begin
 read(n);
end;

procedure solve;
var i,j:longint;
begin
 p[1]:=1;
 for i:=2 to n do
 begin
  p[i]:=1;
  j:=i-1;
  while j<>1 do
  begin
   p[j]:=p[j shr 1];
   j:=j shr 1;
  end;
  p[1]:=i;
 end;
end;

procedure outdata;
var i:longint;
begin
 for i:=1 to n do
 write(p[i],' ');
 writeln;
end;

begin
 assign(input,'heapsort.in');
 reset(input);
 assign(output,'heapsort.out');
 rewrite(output);
 readdata;
 solve;
 outdata;
 close(output);
end.
