using System;
class Program
{
    static void Main()
    {
        string x = Console.ReadLine();
        string y = Console.ReadLine();
        string q = "", m="" ;
        
        if (x.Length >= y.Length)
        {
            for (int i = y.Length - 1; i >= 0; i--)
            {
                int py = Convert.ToInt32(y.Substring(y.Length - 1));
                int px = Convert.ToInt32(x.Substring(x.Length - 1));

                y = y.Remove(y.Length - 1);
                x = x.Remove(x.Length - 1);
                if (px == py)
                {
                    string k = Convert.ToString(px);
                    string k2 = Convert.ToString(py);
                    q += k + k2;
                }
                else
                {
                    int r = Math.Max(px, py);
                    string k = Convert.ToString(r);
                    q += k;
                }


            }
            for (int i = q.Length - 1; i >= 0; i--)
            {
                m += q[i];
            }
            x += m;
            Console.Write(x);

        }
        else if (y.Length >= x.Length)
        {
            for (int i = x.Length - 1; i >= 0; i--)
            {
                int py = Convert.ToInt32(y.Substring(y.Length - 1));
                int px = Convert.ToInt32(x.Substring(x.Length - 1));

                y = y.Remove(y.Length - 1);
                x = x.Remove(x.Length - 1);
                if (px == py)
                {
                    string k = Convert.ToString(px);
                    string k2 = Convert.ToString(py);
                    q += k + k2;
                }
                else
                {
                    int r = Math.Max(px, py);
                    string k = Convert.ToString(r);
                    q += k;
                }

            }
            for (int i = q.Length - 1; i >= 0; i--)
            {
                m += q[i];
            }
            y += m;
            Console.Write(y);
            




        }

    }
}