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

namespace _A__Sudar_brojeva
{
    class Program
    {
        static string Broj(string s1, string s2)
        {

            int x1 = s1.Length; int x2 = s2.Length;

            string s = "", p = "";

            for (int i = 0; i < Math.Abs(x1 - x2); i++)
            {
                p += '0';
            }

            if (x1 > x2)
            {
                s2 = p + s2;
            }
            else
            {
                s1 = p + s1;
            }

            for (int i = s1.Length - 1; i >= 0; i--)
            {
                if (int.Parse(s1[i].ToString()) ==  int.Parse(s2[i].ToString()))
                {
                    s = s1[i].ToString() + s1[i].ToString() + s;
                }
                else
                {
                    s = Math.Max(int.Parse(s1[i].ToString()), int.Parse(s2[i].ToString())).ToString() + s;
                }
            }
            return s;
        }
        static void Main(string[] args)
        {

            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();

            Console.WriteLine(Broj(s1,s2));
        }
    }
}