#include <bits/stdc++.h>
using namespace std;

string s;
string rec;
vector<pair<int, char>> v;
vector<pair<int, char>>::iterator it;

int count(string x, char c) {
	int res = 0;
	for (int i = 0; i < s.length(); i++) {
		if (x[i] == c) res++;
	}
	return res;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	cin >> s;
	cin >> rec;
	for (int i = 0; i < rec.length(); i++) {
		v.push_back(make_pair(count(s, rec[i]), rec[i]));
	}
	sort(v.begin(), v.end());
	replace(s.begin(), s.end(), v[0].second, '*');
	cout << s;

	return 0;
}