using System;

namespace _4
{
    class Program
    {
        static string Cenzura(string n, string x)
        {
            char[] k = n.ToCharArray();
            char[] s = x.ToCharArray();
            for(int i = 1; i < x.Length - 1; i++)
            {
                for(int j = 1; j < n.Length - 1; j++)
                {
                    if (s[i] == k[j] && s[i - 1] == k[j - 1] && s[i + 1] == k[j + 1])
                        k[j] = '*';
                }
            }
            return n = new string(k);
        }
        static void Main(string[] args)
        {
			string n = Console.ReadLine();
			string x = Console.ReadLine();
            Console.WriteLine(Cenzura(n, x));
        }
    }
}