var s:string;
i:integer;
begin
writeln('Введите строку');
readln(s);
for i:=1 to length(s) do
if s[i]='!' then s[i]:='.';
writeln(s);
i:=1;
while i<=length(s) do
begin
if s[i]='.' then
begin
insert('..',s,i);
inc(i,3);
end
else inc(i);
end;
writeln(s);
end.