using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;

namespace ConsoleApp5
{
    internal class Program
    {
        static void Main(string[] args)
        {

            string x = Console.ReadLine();
            string y = Console.ReadLine();

            char[] r = new char[100];

            int i = 0;



            int index = 0;

            for (i = 1; i < 100; i++)
            {
                if(i <= x.Length && i <= y.Length && x[x.Length - i] > y[y.Length - i])
                {
                    r[index] = x[x.Length - i];
                    index++;
                }

                if (i <= x.Length && i <= y.Length && x[x.Length - i] < y[y.Length - i])
                {
                    r[index] = y[y.Length - i];
                    index++;
                }

                if (i <= x.Length && i <= y.Length && x[x.Length - i] == y[y.Length - i])
                {
                    r[index++] = y[y.Length - i];
                    r[index] = y[y.Length - i];
                    index++;
                }

            }

            for(i = index-1; i >= 0; i--)
            {
                Console.Write(r[i]);
                
            }

            Console.WriteLine();


        }
    }
}