//KY169 字符串去特定字符
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
string s;
char op;
int main()
{
    while(getline(cin,s)){
        cin>>op;
        string res="";
        for(int i=0;i<s.size();i++){
            if(s[i]!=op) res+=s[i];
        }
        cout<<res<<"\n";
    }
    return 0;
}