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

namespace ConsoleApp73
{
    internal class Program
    {
        static void Main(string[] args)
        { int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c1 = 0;
            int c2 = 0;
            int c = 0;
            int br = 0;
            while (a > 0 || b > 0)
            {

              
                c1 = a % 10;
                c2 = b % 10;
                if (c1 > c2) c +=(int)( c1*(Math.Pow(10,br)));
                else if (c1 < c2) c += (int)(c2 * (Math.Pow(10, br)));
                else if(a>0 && b>0 && c1==c2)
                {br++;
                    c += (int)(c2 * (Math.Pow(10, br))+c2 * (Math.Pow(10, br-1)));

                }
                else if (a == 0 && b > 0 )
                {
                   
                    c += (int)(c2 * (Math.Pow(10, br)));

                }
                else if (a > 0 && b == 0)
                {
                    c += (int)(c1 * (Math.Pow(10, br)));

                }
                b /= 10;
                a /= 10;
  br++;



            }
            Console.WriteLine(c);
            
        }
    }
}