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

namespace Sudar_Brojeva_1
{
    internal class Program
    {
        static void Main(string[] args)
        {

            int a;
            int b;
            int br=0;
            int g=1;
            int X=int.Parse(Console.ReadLine());
            int Y=int.Parse(Console.ReadLine());
            while (X > 0 | Y > 0)
            {
                if (X > 0) a = X % 10;
                else a = 0;
                if (Y > 0) b = Y % 10;
                else b = 0;
                if (b > a) br = br + (b * g);
                else if (b < a) br = br + (a * g);
                if (a == b) br = br + (a * g)+(a*g*10);
                if (a == b && Y > 0 | a == b && Y > 0) g = g * 10;
                g = g * 10;
                X = X / 10;
                Y = Y / 10;
            }
            if (X == 0 && Y == 0) Console.WriteLine(br);
            Console.ReadLine();
           

        }
    }
}