using System;
using System.Collections.Generic;

namespace Takmicenje_Sudar_Brojeva
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            var a = new Stack<int>();
            while (x % 10 != 0 || y % 10 != 0)
            {
                if (x % 10 > y % 10)
                {
                    a.Push(x % 10);
                }
                else if (x % 10 < y % 10)
                {
                    a.Push(y % 10);
                }
                else
                {
                    a.Push(x % 10);
                    a.Push(y % 10);
                }
                x /= 10;
                y /= 10;
            }
            foreach (int k in a)
                Console.Write(k);
        }
    }
}