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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x, y, Dx, Dy, i = 1, j = 0, x1, y1, a, b;
            double z = 0;
            x = int.Parse(Console.ReadLine());
            y = int.Parse(Console.ReadLine());

            Dx = x.ToString().Length;
            Dy = y.ToString().Length;

            x1 = x;
            y1 = y;

            while (i <= Dx || i <= Dy)
            {
                a = x1 % 10;
                b = y1 % 10;

                if (a > b)
                {
                    z += a * Math.Pow(10, (double)j);
                }
                else if (a < b)
                {
                    z += b * Math.Pow(10, (double)j);
                }

                else
                {
                    z += a * Math.Pow(10, (double)j);
                    j++;
                    z += a * Math.Pow(10, (double)j);
                }
                x1 /= 10;
                y1 /= 10;
                j++;
                i++;
            }

            Console.WriteLine((int)z);
            Console.ReadKey();
        }
    }
}