using System;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Text;


namespace Bruh{

    class Program{

         static void Main(string[] args){

            long a1 = long.Parse(Console.ReadLine());
            long a2 = long.Parse(Console.ReadLine());
            string s1 = a1.ToString();
            string s2 = a2.ToString();
            int k = s1.Length-s2.Length;
            if(k>0) s2 = a2.ToString("D"+ s1.Length);
            if(k<0) s1 = a1.ToString("D"+s2.Length);
            char[] a = s1.ToCharArray();
            char[] b = s2.ToCharArray();
            string s = "";
            for(int i = a.Length-1;i>=Math.Abs(k);i--){
                if(a[i]>b[i]) s = a[i]+s;
                if(a[i]<b[i]) s = b[i]+s;
                if(a[i]==b[i]) {s = a[i]+s;s=b[i]+s;}
            }
            if(k>0)s=s1.Substring(0,k)+s;
            if(k<0)s=s2.Substring(0,Math.Abs(k))+s;
            Console.WriteLine(s);
         }
    }
}