##C++, 219204 bytes
###Golfed
#include<iostream>
#include<string>
int main(){std::string a, b, c;std::cin>>a>>b>>c;int temp=0;fort=0;for(int x=0;x<b.length();x++){temp=at=a.find(b[x],tempt);if(tempt!=-1){a.replace(tempt,1,c.substr(x,1));}}std::cout<<a;return 0;}
###Ungolfed
#include<iostream>
#include<string>
int main()
{
std::string a, b, c;
std::cin>>a>>b>>c;
int tempt = 0;
for (int x=0;x<b.length();x++) {
tempt = a.find(b[x], tempt);
if (tempt != -1) {
a.replace(tempt,1,c.substr(x, 1));
}
}
std::cout<<a;
return 0;
}