using System;

namespace cetvrti_uopa
{
    class Program
    {
        static void Main(string[] args)
        {
            string t = Console.ReadLine();
            string s = Console.ReadLine();
            int brojac = 0;
            for (int i = 0;i<t.Length;i++)
            {
                if (t[i] == 'a') brojac++;
                if (brojac!=s.Length)
                {
                    Console.Write(t[i]);
                }
                else
                {
                    Console.Write("*");
                    brojac = 0;
                }
            }
            
        }
    }
}