program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
s1, s2, s: string;
p: integer;
begin
readln(s);
readln(s1);
readln(s2);
p := pos(s1, s);
if p > 0 then
begin
delete(s, p, length(s1));
insert(s2, s, p);
end;
writeln(s)
end.