#include <stdio.h>
#include <stack>
#include <string.h>
using namespace std;
char input[1000010];
char boom[40];
int inputsize, boomsize;
stack<pair<int, int>> stc;
void case1()
{
int flag = 0;
for (int i = 0; i < inputsize; i++) {
if (input[i] != boom[0]) {
flag = 1;
printf("%c", input[i]);
}
}
if (flag) printf("\n");
else printf("FRULA\n");
}
void case2()
{
int flag = 0;
for (int i = 0; i < inputsize; i++) {
if (input[i] == boom[0]) { // 같으면 stack에 넣기
stc.push(make_pair(i, 0));
}
else { // 일단 boom의 0번째랑 달라
if (stc.empty()) continue;
// 스택이 비어있으면 버림
if (input[i] == boom[stc.top().second + 1]) {
// boom의 다음 녀석이랑 같으면 stack에 넣기
stc.push(make_pair(i, stc.top().second + 1));
if (stc.top().second + 1 == boomsize) {
// boom이 완성되면 그만큼 pop
for (int j = 0; j < boomsize; j++) {
input[stc.top().first] = '-';
stc.pop();
}
}
}
else {
while (!stc.empty()) {
stc.pop();
}
}
}
}
for (int i = 0; i < inputsize; i++) {
if (input[i] != '-') {
flag = 1;
printf("%c", input[i]);
}
}
if (flag) printf("\n");
else printf("FRULA\n");
}
int main()
{
int i;
scanf("%s\n%s", input, boom);
inputsize = strlen(input);
boomsize = strlen(boom);
if (boomsize == 1) case1();
else case2();
return 0;
}