using System;
static void Main(string[] args)
        {

            string newNum = "";

            int n1, n2;
            n1 = Convert.ToInt32(Console.ReadLine());
            n2 = Convert.ToInt32(Console.ReadLine());
            while (n1 != -1 || n2 != -1)
            {
                if (n1 % 10 == n2 % 10)
                {
                    newNum = $"{n1 % 10}{n2 % 10}" + newNum;
                }
                else if (n1 % 10 > n2 % 10)
                {
                    
                    newNum =  n1 % 10 + newNum;
                }
                else if (n2 % 10 > n1 % 10)
                {
                    newNum = n2 % 10 + newNum;
                }
                n1 /= 10;
                n2 /= 10;
                if (n1 == 0) n1 = -1;
                if (n2 == 0) n2 = -1;

            }
            int c = 0;
            while (newNum[c] == 0)
            {
                c++;
            }
            newNum = newNum.Substring(c);
            Console.WriteLine(newNum);
        }