using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cenzura
{
    class Program
    {
        static void Main(string[] args)
        {
            int brojac = 0;
            string t = Console.ReadLine();
            char[] c = t.ToCharArray();
            string s = Console.ReadLine();
            char[] c2 = s.ToCharArray();
            for (int i = 0; i < c.Length; i++)
            {
                if (c[i] == 'a') brojac++;
                else brojac = 0;
                if (brojac == c2.Length)
                {
                    c[i] = '*';
                    brojac = 0;
                }
            }
            for (int i = 0; i < c.Length; i++)
            {
                Console.Write(c[i]);
            }
            Console.WriteLine();
        }
    }
}