using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            string s = "";
            while (x > 0 && y > 0)
            {
                if (x % 10 == y % 10)
                {
                    s = x % 10 + s;
                    s = x % 10 + s;
                }
                else
                {
                    s = Math.Max(x % 10, y % 10) + s;
                }
                x /= 10;
                y /= 10;
            }
            while (x > 0)
            {
                s = x % 10 + s;
                x /= 10;
            }
            while (y > 0)
            {
                s = y % 10 + s;
                y /= 10;
            }
            Console.WriteLine(s);
        }
    }
}