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

namespace ConsoleApp12
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int minbroj = Math.Min(x, y);
            string rez = "";
            while(minbroj>0)
            {
                
                int cifra1 = x % 10;
                int cifra2 = y % 10;
                int brres = Math.Max(cifra1, cifra2);
                if (cifra1 == cifra2) rez = cifra1.ToString() + cifra2.ToString() + rez;
                else rez = brres.ToString()  + rez;
                minbroj /= 10;
                x /= 10;
                y /= 10;


            }
            if (x > y) rez = x.ToString() + rez;
            else if(y > x) rez = y.ToString() + rez;
            Console.WriteLine(rez);
            Console.Read();
            

        }
    }
}