using System;

namespace Takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int br = 1;
            int r = 0;
            while (a>0 || b>0)
            {
                if (a == 0) a = -1;
                if (b == 0) b = -1;
                if(a%10>b%10)
                {
                    r += a % 10 * br;
                }
                else if(a%10<b%10)
                {
                    r += b%10 * br;
                }
                else
                {
                    r += a%10 * br;
                    br *= 10;
                    r += b%10 * br;
                }
                br *= 10;
                a /= 10;
                b /= 10;
            }
            Console.WriteLine(r);
        }
    }
}