using System;

namespace Tkmicenje_3._godina_4._zadatak
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string s1 = Console.ReadLine();
            int[] niz = new int[s1.Length + 1];
            int[] niz2 = new int[s1.Length];
            niz[s1.Length] = 1;
            for (int i = s.Length - 1; i >= 0; i--)
            {
                for (int j = s1.Length - 1; j >= 0; j--)
                {
                    if (s[i] == s1[j])
                    {
                        niz2[j]++;
                        niz[j] += niz[j + 1];
                    }
                }
            }
            if(niz[0] > 0)
            {
                int k = 0;
                int min = int.MaxValue;
                for(int i = 0; i < s1.Length; i++)
                {
                    if(min > niz2[i])
                    {
                        min = niz2[i];
                        k = i;
                    }
                }
                for(int i = 0; i < min; i++)
                {
                    s = s.Substring(0, s.IndexOf(s1[k])) + "*" + s.Substring(s.IndexOf(s1[k]) + 1);
                }
            }
            Console.WriteLine(s);
        }
    }
}