using System;

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

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

            NoviBroj(a, b);
        }
    }
}