#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 10010;
char s[maxn],s1[maxn];
bool hashtable[1000] = {false};
int main()
{
fgets(s,maxn,stdin);
fgets(s1,maxn,stdin);
int len = strlen(s),len1 = strlen(s1);
for(int i = 0; i < len1; i++)
{
if(hashtable[s1[i]] == false)
hashtable[s1[i]] = true;
}
for(int i = 0; i < len; i++)
{
if(hashtable[s[i]] == true)
continue;
else
{
printf("%c",s[i]);
}
}
return 0;
}