using System;

namespace sudar_brojeva
{
    class Program
    {
        static string NoviBroj (string a, string b)
        {
            string s = "";
            if(a.Length > b.Length)
            {
                for (int i = 0; i < a.Length - b.Length; i++)
                {
                    s += a[i];
                }
                for (int i = 0;i < b.Length; i++)
                {
                    if(Convert.ToInt32(a[i + a.Length - b.Length]) > Convert.ToInt32(b[i]))
                    {
                        s += a[i + a.Length - b.Length];
                    }
                    else if (Convert.ToInt32(a[i + a.Length - b.Length]) < Convert.ToInt32(b[i]))
                    {
                        s += b[i];
                    }
                    else
                    {
                        s += a[i + a.Length - b.Length];
                        s += b[i];
                    }
                }             
            }
            else
            {
                for (int i = 0; i < b.Length - a.Length; i++)
                {
                    s += b[i];
                }
                for (int i = 0; i < a.Length; i++)
                {
                    if (Convert.ToInt32(a[i]) > Convert.ToInt32(b[i + (b.Length - a.Length)]))
                    {
                        s += a[i];
                    }
                    else if (Convert.ToInt32(a[i]) < Convert.ToInt32(b[i + (b.Length - a.Length)]))
                    {
                        s += b[i + (b.Length - a.Length)];
                    }
                    else
                    {
                        s += a[i];
                        s += b[i + (b.Length - a.Length)];
                    }
                }
                
            }
            return s;
        }

        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            string b = Console.ReadLine();

            Console.WriteLine(NoviBroj(a, b));
        }
    }
}