#include <iostream>
using namespace std;
int main() {
string s,a,b;
while (getline(cin,s)) { // 注意 while 处理多个 case
getline(cin,a);
getline(cin,b);
s=" "+s+" ";
a=" "+a+" ";
b=" "+b+" ";
int start;
while(1){
start = s.find(a);
if(start == string::npos)break;
else{
s.erase(start,a.size());
s.insert(start,b);
}
}
int n=s.size();
cout<<s.substr(1,n-2)<<endl;
}
return 0;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号