#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 DELETE(char *TEXT, char *PATTERN)
{
int LOC=SEARCH(TEXT,PATTERN);
int M=strlen(PATTERN);
int N=strlen(TEXT);
for(int i=LOC+M;i<N;i++)
{
TEXT[i-M]=TEXT[i];
}
TEXT[N-M]='\0';
}
int main()
{
char TEXT[100],PATTERN[100];
scanf("%s%s",TEXT,PATTERN);
DELETE(TEXT,PATTERN);
cout<<TEXT<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBTRUFSQ0goY2hhciAqVEVYVCwgY2hhciAqUEFUVEVSTikKewogICAgaW50IGksajsKICAgIGludCBNPXN0cmxlbihQQVRURVJOKTsKICAgIGludCBOPXN0cmxlbihURVhUKTsKICAgIGZvciAoaSA9IDA7IGkgPD0gTiAtIE07IGkrKykKICAgIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgTTsgaisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKFRFWFRbaSArIGpdICE9IFBBVFRFUk5bal0pCiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAKICAgICAgICBpZiAoaiA9PSBNKQogICAgICAgICAgICByZXR1cm4gaTsKICAgIH0KICAgIHJldHVybiAtMTsKfQoKdm9pZCBERUxFVEUoY2hhciAqVEVYVCwgY2hhciAqUEFUVEVSTikKewogICAgaW50IExPQz1TRUFSQ0goVEVYVCxQQVRURVJOKTsKICAgIGludCBNPXN0cmxlbihQQVRURVJOKTsKICAgIGludCBOPXN0cmxlbihURVhUKTsKICAgIGZvcihpbnQgaT1MT0MrTTtpPE47aSsrKQogICAgewogICAgICAgIFRFWFRbaS1NXT1URVhUW2ldOwogICAgfQogICAgVEVYVFtOLU1dPSdcMCc7Cn0KCmludCBtYWluKCkKewogICAgY2hhciBURVhUWzEwMF0sUEFUVEVSTlsxMDBdOwogICAgc2NhbmYoIiVzJXMiLFRFWFQsUEFUVEVSTik7CiAgICAKICAgIERFTEVURShURVhULFBBVFRFUk4pOwogICAgY291dDw8VEVYVDw8ZW5kbDsKICAgIAogICAgcmV0dXJuIDA7Cn0=