#include <cstdio>
#include <string>

using namespace std;

int main() {
	string s;
	char c;
	while (cin >> s >> c) {
		for(int i = 0; i < s.size(); i++) {
			while (s[i] == c) {
				s.erase(i, 1);
			}
		}
		cout << s;
	}
	return 0;
}