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

namespace aaa
{

    class Program
    {
        public static void Main()
        {
            uint x = uint.Parse(Console.ReadLine()), y = uint.Parse(Console.ReadLine());
            string res = "";
            uint i = 0;
            
            do
            {
                if ((x % 10) > (y % 10))
                {
                    res = x % 10 + res;
                    x /= 10;
                    y /= 10;
                    i++;
                }

                else if ((x % 10) == (y % 10) && (x != 0 && y != 0))
                {
                    res = x % 10 + res;
                    i++;
                    res = y % 10 + res;
                    x /= 10;
                    y /= 10;
                    i++;
                }
                else
                {
                    res = y % 10 + res;
                    y /= 10;
                    x /= 10;
                    i++;
                }
                Console.WriteLine(res);
            } while ((x != 0 || y != 0));
            Console.WriteLine(res);
        }

    }
}