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

namespace ConsoleApp45
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string p = Console.ReadLine();
            string d = Console.ReadLine();
            int r = Math.Abs(p.Length - d.Length);
            if(p.Length > d.Length)
                {
                 for(int i = 0; i < r; i++)
                    { Console.Write(p[i]); }
                p = p.Substring(r);
                }
            else if (p.Length < d.Length)
                {
                for(int i = 0; i < r ; i++)
                   { Console.Write(d[i]); }
                d = d.Substring(r);
                }
            for(int i = 0; i < Math.Min(p.Length, d.Length); i++)
            {
                 if(Convert.ToInt32(p[i]) > Convert.ToInt32(d[i]))
                 { Console.Write(p[i]); }
                 else if (Convert.ToInt32(p[i]) < Convert.ToInt32(d[i]))
                 { Console.Write(d[i]); }
                 else
                 { Console.Write(d[i]);
                    Console.Write(d[i]);
                 }
            }
        }
    }
}