var fin,fout:textfile;
    i,n:longint;

begin
  assignfile(fin,'heapsort.in');
  assignfile(fout,'heapsort.out');
  reset(fin);
  rewrite(fout);
  read(fin,n);
  write(fout,n);
  for i:=n-1 downto 1 do
  begin
    write(fout,' ', i);
  end;
  writeln(fout);
  closefile(fin);
  closefile(fout);
end.