// radC++.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include<unordered_map>
#include<algorithm>
#include <string>
#include <cstdio>
#include <utility>
#include<tuple>
#include <limits>
#include <iterator>
using namespace std;
#define ll long long



int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	unordered_map<char, int>mapa;
	string tekst;
	string zabrana;
	getline(cin, tekst);
	getline(cin, zabrana);
	int count = 0;
	for (auto x : tekst)
	{
		if (x == 'a' && count+1<zabrana.size())
		{
			count++;
			cout << 'a';
		}
		else
		{
			if (x == 'a')
			{
				cout << "*";
			}
			else
			{
				cout << x;
			}
		}
	}

	
	
	
}