using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Zadaci
{

    public class Program
    {
        public static void Main()
        {
            char[] s = Console.ReadLine().ToCharArray();//not susy
            char[] t = Console.ReadLine().ToCharArray();//sus
            Dictionary<char,int> pool = new Dictionary<char, int>();
            for (int i = 0; i < t.Length; i++)
            {
                pool.Add(t[i],0);
            }
            for (int i = 0; i < s.Length; i++)
            {
                pool[s[i]]++;
            }
            int counter = int.MaxValue, id = 0;

            for (int i = 0; i < pool.Count; i++)
            {
                if (pool[s[i]] < counter)
                {
                    counter = pool[s[i]];
                    id = i;
                }
            }
            char zaBrisanje = s[id];
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == zaBrisanje)
                    s[i] = '*';
            }
            for (int i = 0; i < s.Length; i++)
            {
                Console.Write(s[i]);
            }
            Console.WriteLine();
        }
    }
}