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

namespace SudarBrojeva
{
    class Program
    {
        static void Main(string[] args)
        {
            string x = Console.ReadLine();
            string y = Console.ReadLine();
            string rez="";
            int pok1 = x.Length - 1;
            int pok2 = y.Length - 1;
            while(pok1>=0&&pok2>=0)
            {
                if (int.Parse(x[pok1]+"") > int.Parse(y[pok2]+""))
                {
                    rez =x[pok1]+rez;
                }
                else if (int.Parse(x[pok1]+"") < int.Parse(y[pok2]+""))
                {
                    rez =y[pok2]+ rez;
                }
                else
                {
                    rez = x[pok1] + ""+y[pok2]+ rez;
                }
                pok1--;
                pok2--;
            }
            if(x.Length>y.Length)
            {
                for(int i=pok1;pok1>=0;pok1--)
                {
                    rez = x[pok1] + rez;
                }
            }
            else if(y.Length>x.Length)
            {
                for (int i = pok2; pok2 >= 0; pok2--)
                {
                    rez = y[pok2] + rez;
                }
            }
            Console.WriteLine(rez);
        }
    }
}