var
 fin,fout:textfile;
 map:array[1..50002] of longint;
 n,i,j,k:longint;
begin
 assignfile(fin,'heapsort.in');
 assignfile(fout,'heapsort.out');
 reset(fin);
 rewrite(fout);
 readln(fin,n);
 if n=1 then writeln(fout,1);
 if n=2 then writeln(fout,'2 1');
 if n=3 then writeln(fout,'3 2 1');
 if n=4 then writeln(fout,'4 2 3 1');
 if n=5 then writeln(fout,'5 4 3 2 1');
 if n>5 then begin
  map[1]:=5;
  map[2]:=4;
  map[3]:=3;
  map[4]:=2;
  map[5]:=1;
  for i:=6 to n do begin
   j:=i-1;
   while j>1 do begin
    k:=map[j];
    map[j]:=map[j div 2];
    map[j div 2]:=k;
    j:=j div 2;
   end;
   map[i]:=1;
   map[1]:=i;
  end;
  write(fout,map[1]);
  for i:=2 to n do begin
   write(fout,' ',map[i]);
  end;
  writeln(fout,'');
 end;
 closefile(fin);
 closefile(fout);
end.