#include <stdio.h>
#include <string.h>

int main(void) {
	char sntc[150];
	char word[30];
    char *found;
    size_t wordlen;
    fgets(sntc,sizeof(sntc),stdin);
    fgets(word,sizeof(word),stdin);
    wordlen=strlen(word)-1;
    word[wordlen]=0;
    while((found=strstr(sntc,word))!=NULL)
        memmove(found,found+wordlen,strlen(found+wordlen)+1);
    printf("%s",sntc);
	return 0;
}