using System;

namespace kvalifikacije1_2022
{
    class Program
    {
        static void Main(string[] args)
        {
            long x = long.Parse(Console.ReadLine());
            long y = long.Parse(Console.ReadLine());

            int br1 = 0;
            int br2 = 0;

            long xx = x;
            long yy = y;

            int priv;
            long cifra = 0;
            int stepen = 0;

            while (xx != 0)
            {
                br1++;
                xx = xx / 10;
            }
            while (yy != 0)
            {
                br2++;
                yy = yy / 10;
            }
            if (br1 >= br2)

                priv = br1;

            else
                priv = br2;

            for(int i = 0;i<priv;i++)
            {
                if (x % 10 > y % 10)
                {
                    /*long xxx = x % 10;*/
                    cifra = cifra + x % 10 * (long)(Math.Pow(10, stepen));
                    x = x / 10;
                    y = y / 10;
                    stepen++;
                }
                else if (y % 10 > x % 10)
                {
                    cifra = cifra + y % 10 * (long)(Math.Pow(10, stepen));
                    x = x / 10;
                    y = y / 10;
                    stepen++;
                }
                else if (x % 10 == 0 && y % 10 == 0)
                {
                    cifra = cifra + 0 % 10 * (long)(Math.Pow(10, stepen));
                    x = x / 10;
                    y = y / 10;
                    stepen++;
                }
                else if(x % 10 == y % 10)
                {
                    cifra = cifra + x % 10 * (long)(Math.Pow(10, stepen)) + x % 10 * (long)(Math.Pow(10, stepen + 1));
                    x = x / 10;
                    y = y / 10;
                    stepen = stepen + 2;
                } 
            }
            Console.WriteLine(cifra);
        }
    }
}