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

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

            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            string z = "";
            do
            {
                if (y == 0 && x % 10 == 0 || x == 0 && y % 10 == 0) z = 0 + "" + z;
                else
                {
                if (x % 10 > y % 10) z = x % 10 + z;    
                else if(x % 10 == y % 10) z = x % 10 + "" + y % 10 + z;             
                else z = y % 10 + z;          
                }
                x = x / 10;
                y = y / 10;
            } while (y > 0 || x > 0);
            Console.WriteLine(z);
        }
    }
}