using System;

namespace SUDARI
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            Int64 ab = 0;
            double i = 0;
            while(a!=0 && b!=0)
            {
                int c1 = a % 10; a /= 10;
                int c2 = b % 10; b /= 10;
                if (c1 > c2)
                { ab += c1 * (Int64)(Math.Pow(10, i)); i++; }
                else if (c2 > c1)
                { ab += c2 * (Int64)(Math.Pow(10, i)); i++; }
                else
                {
                    ab += c1 * (Int64)(Math.Pow(10, i));
                    i++;
                    ab += c1 * (Int64)(Math.Pow(10, i));
                    i++;
                }
            }
            if (a == 0)
                ab += b * (Int64)(Math.Pow(10, i));
            else ab += a * (Int64)(Math.Pow(10, i));
            Console.WriteLine(ab);
        }
    }
}