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

namespace Zadatak1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int broj = 0, n = 1;

            while (a > 0 && b > 0)
            {
                if (a % 10 > b % 10) broj += a % 10 * n;
                else if (b % 10 > a % 10) broj += b % 10 * n;
                else
                {
                    broj += b % 10 * n * 10 + a % 10 * n;
                    n *= 10;
                }
                a /= 10; b /= 10; n *= 10;
            }

            if (a > 0)
                Console.WriteLine(a.ToString() + broj.ToString());
            else if (b > 0)
                Console.WriteLine(b.ToString() + broj.ToString());
            else
                Console.WriteLine(broj);
        }
    }
}