#include<bits/stdc++.h>
using namespace std;
int main(){
    string s,d,f;
    getline(cin,s);
    getline(cin,d);
    getline(cin,f);
    bool l=0;
    for(int i=0;i<s.size();i++){
    	l=0;
    	for(int j=0;j<d.size();j++){
    		if(s[j+i]!=d[j]) l=1;
    	}
    	if(l==0){
    		cout<<f;
    		i+=d.size()-1;
    	}
    	else cout<<s[i];
    }
return 0;}
 
/**************************************************************
	Problem: 1112
	User: fzy001
	Language: C++
	Result: Accepted
	Time:16 ms
	Memory:2076 kb
****************************************************************/