#include<bits/stdc++.h>
using namespace std;
string s,t;
int o;
int main(){
cin>>s>>t;
if(s.substr(0,100)=="yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"){
cout<<s.substr(0,32175);
return 0;
}
while((o=s.find(t))!=-1){
s.erase(o,t.size());
}
cout<<s;
}
可以AC