#include<iostream>
#include<unordered_set>
using namespace std;
string s1,s2;
int main()
{
getline(cin,s1);
getline(cin,s2);
unordered_set<char> hash;
for(auto c:s2) hash.insert(c);
string res;
for(auto c:s1)
if(!hash.count(c))
res+=c;
cout<<res;
return 0;
}