using System;

namespace Takmicenje___Sudar_brojeva
{
    class Program
    {
        static void Main(string[] args)
        {
            long a = Convert.ToInt64(Console.ReadLine());
            long b = Convert.ToInt64(Console.ReadLine());

            string aa = a.ToString();
            string bb = b.ToString();

            int xa = aa.Length - 1;
            int xb = bb.Length - 1;

            int duzinamanja = Math.Min(aa.Length, bb.Length);

            string resenje = null;

            while(xa >= 0 && xb >= 0)
            {
                if (aa[xa] > bb[xb]) resenje = aa[xa] + resenje;
                else if (bb[xb] > aa[xa]) resenje = bb[xb] + resenje;
                else resenje = (Convert.ToInt64(aa[xa]) - 48).ToString() + (Convert.ToInt64(bb[xb]) - 48).ToString() + resenje;
                xa--;
                xb--;
            }

            if(xa >= 0)
            {
                while(xa >= 0)
                {
                    resenje = aa[xa] + resenje;
                    xa--;
                }
            }

            if(xb >= 0)
            {
                while(xb >= 0)
                {
                    resenje = bb[xb] + resenje;
                    xb--;
                }
            }

            Console.WriteLine(resenje);
        }
    }
}