using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
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());
            string n = X.ToString();
            int nn = n.Length;
            
            string m = Y.ToString();
            int mm = m.Length;
            
            int k = 0;
            if (X > Y)
            {
                k = X;
            }
            else
            {
                k = Y;
            }
            int S = 0;
            int aX = 0;
            int aY = 0;
            int l = 1;
            for(int i = 1; i < k;)
            {
                k = k / 10;
                aX = X % 10;
                aY = Y % 10;
                Y = Y / 10;
                X = X / 10;
                

                if (nn != 0 && mm != 0)
                {


                    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;

                }
                
                else if(nn == 0)
                {
                    while (mm != 0)
                    {
                        mm--;
                        S = S + aY * l;
                        l = l * 10;

                        aY = Y % 10;
                        Y = Y / 10;
                        
                       
                        


                    }
                    break;
                }
                else if (mm == 0)
                {
                    while (nn != 0)
                    {
                        nn--;
                        S = S + aX * l;
                        l = l * 10;
                        aX = X % 10;
                        X = X / 10;
                       
                    }
                    break;
                }
                nn = nn - 1;
                mm = mm - 1;

            }
            Console.WriteLine(S);



            
        }
    }
}