using System;

namespace MyApp // Note: actual namespace depends on the project name.
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string broj1 = Console.ReadLine();
            string broj2 = Console.ReadLine();
            char[] ch1 = new char[broj1.Length];
            char[] ch2 = new char[broj2.Length];
            char[] ch3 = new char[broj1.Length+broj2.Length];
            //int rezbroj = Resi1(broj1, broj2, rez);
            //Console.WriteLine(rezbroj);
            int i = 0;
            for (i = 0;i<broj1.Length;i++)
            {
                ch1[i] = broj1[broj1.Length-i-1];
            }
            for (i = 0; i < broj2.Length; i++)
            {
                ch2[i] = broj2[broj2.Length-i-1];
            }
            i = 0;
            int j = 0;
            int br = 0;
            while(i<broj1.Length && j < broj2.Length)
            {
                if (ch1[i] > ch2[j]) { ch3[br++] = ch1[i]; }
                else if (ch2[j] > ch1[i]) ch3[br++] = ch2[j];
                else { ch3[br++] = ch1[i]; ch3[br++] = ch2[j]; }
                i++;j++;
            }
            while (i < broj1.Length)
            {
                ch3[br++] = ch1[i];
                i++;
            }
            while (j < broj2.Length)
            {
                ch3[br++] = ch2[j];
                j++;
            }
            for (i = br - 1; i >= 0; i--)
            {
                Console.Write(ch3[i]);
            } 
        }

    }
}