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

namespace zadatakA
{
    internal class Program
    {

        static string NoviBroj(string x, string y)
        {
            int brCifX = x.Length;
            int brCifY = y.Length;
            StringBuilder c = new StringBuilder();
            if (brCifX == 1 && brCifY == 1 && x[0] - '0' == 0 && y[0] - '0' == 0)
                return x;
            if(brCifY == brCifX)
            {
                for (int i = 0; i < brCifX; i++)
                {
                    if (x[i] > y[i])
                        c.Append(x[i]);
                    else if (x[i] < y[i])
                        c.Append(y[i]);
                    else
                    {
                        c.Append(x[i]);
                        c.Append(y[i]);
                    }
                }
            }
            else if(brCifX > brCifY)
            {
                int razlika = brCifX - brCifY;
                for (int i = 0; i < razlika; i++)
                {
                    c.Append(x[i]);
                }
                for (int i = 0; i < brCifY; i++)
                {
                    if (x[i + razlika] > y[i])
                        c.Append(x[i + razlika]);
                    else if (x[i + razlika] < y[i])
                        c.Append(y[i]);
                    else
                    {
                        c.Append(y[i]);
                        c.Append(x[i + razlika]);
                    }
                }
            }
            else
            {

                int razlika = brCifY - brCifX;
                for (int i = 0; i < razlika; i++)
                {
                    c.Append(y[i]);
                }
                for (int i = 0; i < brCifX; i++)
                {
                    if (y[i + razlika] > x[i])
                        c.Append(y[i + razlika]);
                    else if (y[i + razlika] < x[i])
                        c.Append(x[i]);
                    else
                    {
                        c.Append(x[i]);
                        c.Append(y[i + razlika]);
                    }
                }
                
            }
            return c.ToString();

        }
        static void Main(string[] args)
        {
            long x = int.Parse(Console.ReadLine());
            long y = int.Parse(Console.ReadLine());

            string sX = x.ToString();
            string sY = y.ToString();
            string br = NoviBroj(sX, sY);
            Console.WriteLine(br);
        }
    }
}