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

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();
            string c = "";
            int m = Math.Min(a.Length, b.Length);
            for (int i = 0; i < m; i++)
            {
                char x = a[a.Length - i - 1];
                char y = b[b.Length - i - 1];
                if (x > y) c = x.ToString() + c;
                else if (y > x) c = y.ToString() + c;
                else c = x.ToString() + x.ToString() + c;
            }
            for (int i = 0; i < a.Length - m; i++)
            {
                char x = a[a.Length - m - i - 1];
                c = x.ToString() + c;
            }
            for (int i = 0; i < b.Length - m; i++)
            {
                char y = b[b.Length - m - i - 1];
                c = y.ToString() + c;
            }
            Console.WriteLine(c);
        }
    }
}