#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;

int main() 
{
    string str1, str2;
    getline(cin, str1);
    getline(cin, str2);

    unordered_set<char> hash;
    for(auto c : str2) hash.insert(c);

    string ret;
    for(auto c : str1) 
        if(!hash.count(c)) ret += c;
    
    cout << ret << endl;
    return 0;
}