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

namespace Q1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x, y, a, b, sum, stepen;
            sum = 0;
            stepen = 1;
            x = Convert.ToInt32(Console.ReadLine());
            y = Convert.ToInt32(Console.ReadLine());
            while (x > 0 || y > 0)
            {
                a = x % 10;
                b = y % 10;
                if (a > b)
                {
                    sum = sum + a * stepen;
                }

                if (a < b)
                {
                    sum = sum + b * stepen;
                }


                if (a == b && (a > 1 && b > 1))
                {

                    sum = sum + a * stepen + b * stepen * 10;
                    stepen = stepen * 10;
                }

                x = (x - x % 10) / 10;
                y = (y - y % 10) / 10;
                stepen = stepen * 10;
            }
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}