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

namespace A_Sudar_brojeva
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            int i = a.Length - 1;
            int j = b.Length - 1;
            Stack<char> c = new Stack<char>();
            while (i >= 0 && j >= 0)
            {
                if (a[i] > b[j])
                    c.Push(a[i]);
                else if (a[i] == b[j])
                {
                    c.Push(a[i]);
                    c.Push(b[j]);
                }
                else
                    c.Push(b[j]);
                i--;
                j--;
            }
            while (i >= 0)
            {
                c.Push(a[i--]);
            }
            while (j >= 0)
                c.Push(b[j--]);
            foreach (char f in c)
                Console.Write(f);
        }
    }
}