//Pascal ABC.NET 3.1 сборка 1256
Var
s,s1:string;
begin
readln(s);
writeln(pos('r',s));
s1:='Bloomed';
delete(s,1,length(s1));
insert('pears',s,1);
delete(s,length(s)-length('pears')+1,length(s1));
insert(s1,s,length(s)+1);
writeln(s);
delete(s,pos('applesand',s),length('applesand'));
writeln(s);
end.
Вывод:
20
pearsapplesandBloomed
pearsBloomed