using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace SudarBrojeva
{
    class Program
    {
        public static string Reverse(string s)
        {
            char[] charArray = s.ToCharArray();
            Array.Reverse(charArray);
            return new string(charArray);
        }
        static void Main(string[] args)
        {
            int x;
            int y;
            string rez = "";
            x = int.Parse(Console.ReadLine());
            y = int.Parse(Console.ReadLine());
            int[]a = new int[12];
            int[] b = new int[12];
            int i = 0;
            int xbr;
            int ybr;
            while (x != 0)
            {
                a[i] = x % 10;
                x = x / 10;
              //  Console.WriteLine(a[i]);
                i++;
            }
            xbr = i;
            
            i = 0;
            while (y != 0)
            {
                b[i] = y % 10;
                y = y / 10;
             //   Console.WriteLine(b[i]);
                i++;
            }
            ybr = i;

            int p = Math.Max(ybr,xbr);
            i = 0;
            while (i < p)
            {
              /*  if (i >= xbr)
                {
                    rez = rez + b[i];
                    i++;
                }
                if (i >= ybr)
                {
                    rez = rez + a[i];
                    i++;
                }*/
                
                {
                    if (a[i] > b[i])
                    {
                        rez = rez + a[i];
                        i++;
                    }
                    else if (a[i] < b[i])
                    {
                        rez = rez + b[i];
                        i++;
                    }
                    else if (a[i] == b[i])
                    {
                        rez = rez + a[i];
                        if (i < xbr && i < ybr && a[i] != 0 && b[i] != 0)
                        {

                            rez = rez + a[i];
                        }
                        i++;
                    }
                }



            }

            rez = Reverse(rez);
            Console.WriteLine(rez);

         


            

            Console.ReadLine();
        }
    }
}