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

namespace ConsoleApplication316
{
    class Program
    {
        static void Main(string[] args)
        {
            long x = long.Parse(Console.ReadLine());
            long y = long.Parse(Console.ReadLine());
            long s = x + y;
            y = Math.Min(x, y);
            x = s - y;
            long p = 1;
            long b = 0;
            s = 0;
            while(y>0)
            {
                int cy = (int)y % 10;
                int cx = (int)x % 10;
                if(cx>cy)
                {
                    s += cx * p;
                    p *= 10;
                    y /= 10;
                    x /= 10;
                }
                else
                {
                    if (cy > cx)
                    {
                        s += cy * p;
                        p *= 10;
                        y /= 10;
                        x /= 10;
                    }
                    else
                    {
                        s += cx * p;
                        p *= 10;
                        s += cy * p;
                        p *= 10;
                        x /= 10;
                        y /= 10;
                    }
                }
            }
            s += p * x;
            Console.WriteLine(s);
            Console.ReadKey();
        }
    }
}