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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            long a = Convert.ToInt64(Console.ReadLine());
            long b = Convert.ToInt64(Console.ReadLine());
            long c = 0,i=1;
            while(a != 0 && b != 0)
            {
                if (a % 10==b % 10)
                {
                    c += a % 10 * i;
                    i = i * 10;
                    c += a % 10 * i;
                    a = a / 10;
                    b = b / 10;
                }
                else if(a % 10 > b % 10)
                {
                    c += a % 10 * i;
                    a = a / 10;
                    b = b / 10;
                }
                else
                {
                    c += b % 10 * i;
                    a = a / 10;
                    b = b / 10;
                }
                i = i * 10;
            }
            while (b != 0)
            {
                c += b % 10 * i;
                b = b / 10;
                i = i * 10;
            }
            while (a != 0)
            {
                c += a % 10 * i;
                a = a / 10;
                i = i * 10;
            }
            Console.WriteLine(c);
            Console.ReadLine();
        }
    }
}