using System;

namespace SudarBrojeva
{
    class Program
    {
        static void Main(string[] args)
        {
            int X = Convert.ToInt32(Console.ReadLine());
            int Y = Convert.ToInt32(Console.ReadLine());
            int Z = 0;
            int k = 1;
            while(X != 0 || Y != 0)
            {
                if((X%10)<(Y%10))
                {
                    Z = Z + k*(Y % 10);
                }
                else if ((X%10)>(Y%10))
                {
                    Z = Z + k*(X % 10);
                }
                else if((X%10)==0 && (Y%10)==0 && (X==0 || Y==0))
                {
                    ;
                }
                else
                {
                    Z = Z + k*(X % 10)+ k*10*(Y % 10);
                    k = k * 10;
                }
                X = X / 10;
                Y = Y / 10;
                k = k * 10;
            }
            Console.WriteLine(Z);
        }
    }
}