program zad4;
uses crt;
var
c,i:integer;
bb,b:string[1];
ns,s:string;
begin
clrscr;
writeln('VVEDITE STROKU');
readln(s);
writeln('VVEDITE BUKVU');
readln(bb);
c:=length(s);
for i:=1 to c do begin
b:=copy(s,i,1);
if b='.' then ns:=ns+'!' else if b=bb then ns:=ns+' ' else ns:=ns+b;
end;
writeln('NOVOYA STROKA->');
writeln(ns);
readkey;
end.