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

namespace Sudar_brojeva
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int x1 = x;
            int y1 = y;
            int br1 = 0;
            int br2 = 0;
            int novi = 0;
            int s = 1;
            while (x > 0)
            {
                br1++;
                x /= 10;
            }
            while (y > 0)
            {
                br2++;
                y /= 10;
            }
            if (br1 == br2)
            {
                while (x1 > 0)
                {
                    if ((x1 % 10) > (y1 % 10))
                    {
                        novi = x1 % 10 * s + novi;
                        s *= 10;
                    }
                    else if ((x1 % 10) == (y1 % 10)) { novi = x1 % 10 * 11 * s + novi; s *= 100; }
                    else { novi = y1 % 10 * s + novi; s *= 10; }
                    y1 /= 10;
                    x1 /= 10;
                }

            }
            else if(br1>br2)
            {
                while (y1 > 0)
                {
                    if ((x1 % 10) > (y1 % 10))
                    {
                        novi = x1 % 10 * s + novi;
                        s *= 10;
                    }
                    else if ((x1 % 10) == (y1 % 10)) { novi = y1 % 10 * 11 * s + novi; s *= 100; }
                    else { novi = y1 % 10 * s + novi; s *= 10; }
                    y1 /= 10;
                    x1 /= 10;
                }
                while (x1 > 0)
                {

                    novi = x1 % 10 * s + novi;
                    x1 /= 10;
                    s *= 10;
                }
            }
            else
            {
                while (x1 > 0)
                {
                    if ((x1 % 10) > (y1 % 10))
                    {
                        novi = x1 % 10 * s + novi;
                        s *= 10;
                    }
                    else if ((x1 % 10) == (y1 % 10)) { novi = x1 % 10 * 11 * s + novi; s *= 100; }
                    else { novi = y1 % 10 * s + novi; s *= 10; }
                    y1 /= 10;
                    x1 /= 10;
                }
                while (y1 > 0)
                {

                    novi = y1 % 10 * s + novi;
                    y1 /= 10;
                    s *= 10;
                }
            }
            Console.WriteLine(novi);
        }
    }
}