import java.util.*;
public class A {
public static void main(String args[])
{
Scanner cin=new Scanner(System.in);
while(cin.hasNext())
{
String A=cin.next();
String B=cin.next();
String C=cin.next();
A=A.replace(B, C);
System.out.println(A);
}
}
}