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

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

            int X = Convert.ToInt32(Console.ReadLine());
            int Y = Convert.ToInt32(Console.ReadLine());
            int k = 0;
            if (X > Y)
            {
                k = X;
            }
            else
            {
                k = Y;
            }
            int S = 0;//novi broj
            int aX = 0;
            int aY = 0;
            int l = 1;
            for(int i = 1; i < k;)
            {
                k = k / 10;
                aX = X % 10;
                aY = Y % 10;
                if (aX > aY)
                {
                    S = S + aX * l;
                }
                else if (aX < aY)
                {
                    S = S + aY * l;
                }
                else if (aX == aY)
                {
                    S = S + aX * l;
                    l = l * 10;
                    S = S + aY * l;
                }
                l = l * 10;
            }
            Console.WriteLine(S);



            Console.ReadLine();
        }
    }
}