#include<bits/stdc++.h>
using namespace std;
int SEARCH(char *TEXT, char *PATTERN)
{
int i,j;
int M=strlen(PATTERN);
int N=strlen(TEXT);
for (i = 0; i <= N - M; i++)
{
for (j = 0; j < M; j++)
{
if (TEXT[i + j] != PATTERN[j])
break;
}
if (j == M)
return i;
}
return -1;
}
void REPLACE(char *TEXT, char *PATTERN,char *PATTERN2)
{
int LOC=SEARCH(TEXT,PATTERN);
int M=strlen(PATTERN);
int N=strlen(TEXT);
for(int i=0;i<M;i++)
{
TEXT[LOC+i]=PATTERN2[i];
}
}
int main()
{
char TEXT[100],PATTERN[100],PATTERN2[100];
scanf("%s%s%s",TEXT,PATTERN,PATTERN2);
REPLACE(TEXT,PATTERN,PATTERN2);
cout<<TEXT<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBTRUFSQ0goY2hhciAqVEVYVCwgY2hhciAqUEFUVEVSTikKewogICAgaW50IGksajsKICAgIGludCBNPXN0cmxlbihQQVRURVJOKTsKICAgIGludCBOPXN0cmxlbihURVhUKTsKICAgIGZvciAoaSA9IDA7IGkgPD0gTiAtIE07IGkrKykKICAgIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgTTsgaisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKFRFWFRbaSArIGpdICE9IFBBVFRFUk5bal0pCiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAKICAgICAgICBpZiAoaiA9PSBNKQogICAgICAgICAgICByZXR1cm4gaTsKICAgIH0KICAgIHJldHVybiAtMTsKfQoKdm9pZCBSRVBMQUNFKGNoYXIgKlRFWFQsIGNoYXIgKlBBVFRFUk4sY2hhciAqUEFUVEVSTjIpCnsKICAgIGludCBMT0M9U0VBUkNIKFRFWFQsUEFUVEVSTik7CiAgICBpbnQgTT1zdHJsZW4oUEFUVEVSTik7CiAgICBpbnQgTj1zdHJsZW4oVEVYVCk7CiAgICBmb3IoaW50IGk9MDtpPE07aSsrKQogICAgewogICAgICAgIFRFWFRbTE9DK2ldPVBBVFRFUk4yW2ldOwogICAgfQp9CgppbnQgbWFpbigpCnsKICAgIGNoYXIgVEVYVFsxMDBdLFBBVFRFUk5bMTAwXSxQQVRURVJOMlsxMDBdOwogICAgc2NhbmYoIiVzJXMlcyIsVEVYVCxQQVRURVJOLFBBVFRFUk4yKTsKICAgIAogICAgUkVQTEFDRShURVhULFBBVFRFUk4sUEFUVEVSTjIpOwogICAgY291dDw8VEVYVDw8ZW5kbDsKICAgIAogICAgcmV0dXJuIDA7Cn0=