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

namespace Zadaci
{
    class Program
    {
        static void Main(string[] args)
        {
            long a, b,c=0,brojac=1;
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());
            while (Math.Max(a,b) != 0)
            {
                if(Math.Min(a,b) == 0) { c += Math.Max(a,b) % 10 * brojac; brojac *= 10; }
                else if (a % 10 > b % 10) { c += a % 10 * brojac; brojac *= 10; }
                else if (a % 10 < b % 10) { c += b % 10 * brojac; brojac *= 10; }
                else {c += a % 10 * brojac*10 + b % 10 * brojac; brojac *= 100; }
                a/=10;
                b/=10;
            }
            Console.WriteLine(c);
        }
    }
}