program spos;
var
s: string;
i, algus, ots: integer;
begin
s:='Tere, kallis vanaema!';
algus:=pos('', s);
delete(s, algus, 3);
ots:=pos('', s);
delete(s, ots, 4);
writeln(s);
write(copy(s, 1, algus-1));
for i:=algus to ots do
write(' ',s[i]);
writeln(copy(s, ots, length(s)-ots));
end.