str1=input()
str2=input()
str3=input()
x=str1.replace(str2,str3)
print(x)
/**************************************************************
	Problem: 1112
	User: admin
	Language: Python
	Result: Accepted
	Time:187 ms
	Memory:34244 kb
****************************************************************/