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

namespace ConsoleApp1
{
    class Program
    {

        static void Main(string[] args)
        {
            long a,b,c=0,br=1;
            a=long.Parse(Console.ReadLine());
            b=long.Parse(Console.ReadLine());
            while(a>0||b>0)
            {
                if(a%10 > b % 10)
                {
                    c += (a % 10)*br;
                    a /= 10;
                    b /= 10;
                    br *= 10;
                }
                else if(a%10 < b % 10)
                {
                    c += (b % 10) * br;
                    a /= 10;
                    b /= 10;
                    br*=10;
                }
                else
                {
                    if (b % 10 == a % 10 && b % 10==0)
                    {
                        c += (b % 10) * br;
                        a /= 10;
                        b /= 10;
                        br *= 10;
                    }
                    else
                    {
                        c += (b % 10) * br;
                        br *= 10;
                        c += (b % 10) * br;
                        br *= 10;
                        a /= 10;
                        b /= 10;
                    }
                }
            }
            Console.WriteLine("{0}", c);
        }
    }
}