using System;

namespace tak1
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine()), y = int.Parse(Console.ReadLine());
            int mod = 1;
            int z = 0;

            while (mod < x || mod < y)
            {
                int a = x / mod % 10, b = y / mod % 10;
                if (a > b)
                {
                    z += a * mod;
                }
                else if (a == b)
                {

                    z += a * 10;
                }
                else
                {
                    z += b * mod;
                }

                mod *= 10;
            }
            Console.WriteLine(z);
        }
    }
}