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

int main() {
	char texto[200], word[10];
	scanf("%199[^\n]", texto);
	scanf("%9s", word);

	int i, presente = 0, tam = strlen(word);
	for(i=0; texto[i] != '\0'; i++) {
        if (memcmp(&texto[i], word, tam) == 0){
            presente = 1;
            for (; texto[i] != '\0'; i++){
                texto[i] = texto[i + tam];
            }
            break;
        }
	}

	if (presente) {
		printf("%s\n",texto);
	} else {
		printf("Termo não encontrado na frase.\n");
	}
	return 0;
}
