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

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string r = string.Empty;
            int x = int.Parse(Console.ReadLine()), y = int.Parse(Console.ReadLine());
            while (x > 0 || y > 0)
            {
                int tmp = 0, tmpx = x % 10, tmpy = y % 10;
                if (tmpx == tmpy && x != 0 && y != 0)  
                {
                    tmp = (tmpx * 10 + tmpx);
                    //r += (int)Math.Pow(10, i) * tmp;
                    r = tmp.ToString() + r;
                }
                else
                {
                    tmp = (tmpx > tmpy ? tmpx : tmpy);
                    //r += (int)Math.Pow(10, i) * tmp;
                    r = tmp.ToString() + r;
                }         
                x /= 10;
                y /= 10;
            }
            Console.WriteLine(r);
        }
    }
}