using System;

class Program
{
    static string collideDigits(string s1, string s2)
    {
        if (s2 == String.Empty) return s1;
        int comparison = String.Compare(s1, s2);
        if (comparison < 0) return s2;
        else if (comparison > 0) return s1;
        else return s1 + s2;
    }
    static string collide(string x, string y)
    {
        int i = x.Length - 1;
        int j = y.Length - 1;
        string res = "";
        while (i >= 0)
        {
            res += collideDigits(x[i].ToString(), (j >= 0 ? y[j].ToString() : String.Empty));
            i--;
            j--;
        }
        char[] cArr = res.ToCharArray();
        Array.Reverse(cArr);
        return new string(cArr);
    }
    static void Main(string[] args)
    {
        string x = Console.ReadLine();
        string y = Console.ReadLine();
        if (x.Length >= y.Length)
            Console.WriteLine(int.Parse(collide(x, y)));
        else
            Console.WriteLine(int.Parse(collide(y, x)));
    }
}