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

namespace PetljaTakmicenje
{
    class Program
    {

        static void Main(string[] args)
        {
            string s = "", s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int n = s1.Length, m = s2.Length;
            while (n-- * m-- > 0)
            {
                if (s1[n] > s2[m])
                {
                    s = s1[n] + s;
                }
                else if (s1[n] < s2[m])
                {
                    s = s2[m] + s;
                }
                else
                {
                    s = s1[n] + s1[n] + s;
                }
            }
            while (n > 0)
            {
                s = s1[n--] + s;
            }
            while (m > 0)
            {
                s = s2[m--] + s;
            }
            Console.WriteLine(s);
        }
    }
}