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

namespace takmicenje
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int z = 0;
            while (x % 10 != 0 && y % 10 != 0)
            {
                z *= 10;
                if (x % 10 > y % 10)
                {
                    z += x % 10;
                }
                else if (x % 10 < y % 10)
                {
                    z += y % 10;
                }
                else
                {
                    z += x % 10;
                    z *= 10;
                    z += y % 10;
                }
                x /= 10;
                y /= 10;
            }
            if ((x == 0 && y != 0) || (x != 0 && y == 0))
            {
                z = z * 10;
                while (x != 0)
                {
                    z = x % 10;
                    z = z * 10;
                    x /= 10;
                }
                while (y != 0)
                {
                    z += y % 10;
                    y /= 10;
                }
            }
            int resenje = 0;
            while (z != 0)
            {
                int pom = z % 10;
                resenje = resenje * 10 + pom;
                z /= 10;
            }
            Console.WriteLine(resenje);
            Console.ReadLine();
        }
    }
}