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

namespace Takmicenje
{
    internal class Program
    {
        static void Main(string[] args)
        {       
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            string temp = "";

            while (x%10>0||y%10>0)
            {
                if (x % 10 > y % 10) temp = x % 10 + temp;
                else if (y % 10 > x % 10) temp = y % 10 + temp;
                else if(x%10==y%10) temp = x%10 + "" + y%10 + temp;
                x = x / 10;
                y = y / 10;
            }
            Console.WriteLine(temp);
        }
    }
}