using System;
using System.Collections.Generic;

namespace Takmicenje_petlja_2
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            List<int> finalNumber = new List<int>();
            int xCurrentDigit, yCurrentDigit;
            while (x > 0 && y > 0)
            {
                xCurrentDigit = x % 10;
                yCurrentDigit = y % 10;

                if (xCurrentDigit > yCurrentDigit)
                {
                    finalNumber.Add(xCurrentDigit);
                }
                else if (yCurrentDigit > xCurrentDigit)
                {
                    finalNumber.Add(yCurrentDigit);
                }
                else if (xCurrentDigit == yCurrentDigit)
                {
                    finalNumber.Add(xCurrentDigit);
                    finalNumber.Add(yCurrentDigit);
                }
    
                x /= 10;
                y /= 10;
            }
            if (x != 0)
            {
                while (x > 0)
                {
                    xCurrentDigit = x % 10;
                    finalNumber.Add(xCurrentDigit);
                    x /= 10;
                }
            }

            if (y != 0)
            {
                while (y > 0)
                {
                    yCurrentDigit = y % 10;
                    finalNumber.Add(yCurrentDigit);
                    y /= 10;
                }
            }
            for (int i = finalNumber.Count - 1; i > -1; i--)
            {
                Console.Write(finalNumber[i]);
            }
        }
    }
}