using System;

namespace prvi

{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            string nstring = n.ToString();
            string mstring = m.ToString();
            int nduzina=nstring.Length;
            int mduzina=mstring.Length;
            string konacni = "";

            while (nstring.Length < mstring.Length)
            {
                nstring = "0" + nstring;
            }

            while (nstring.Length > mstring.Length)
            {
                mstring = "0" + mstring;
            }

            //Console.WriteLine("n string je " + nstring);
            //Console.WriteLine("mstring je" + mstring);

            for (int i =0; i < nstring.Length ; i++)
            {

                if((int)nstring[i]>(int)mstring[i])
                {
                    konacni =konacni + nstring[i];
                }

                if ((int)nstring[i] < (int)mstring[i])
                {
                    konacni = konacni + mstring[i];
                }

                if ((int)nstring[i] == (int)mstring[i])
                {

                    //Console.WriteLine("radi se prva if");

                    if ((int)nstring[i]-48 ==0 &&  i >= nduzina - 1)
                    {
                        Console.WriteLine("radi se prva if");
                        konacni = konacni + mstring[i];
                    }

                     else if ((int)mstring[i]-48 == 0 && i > mduzina - 1)
                        konacni = konacni + nstring[i];

                     else if((int)nstring[i]!=0)
                        konacni=konacni + mstring[i]+nstring[i];
                    //else
                    //konacni = konacni + nstring[i] +mstring[i];
                   
                }
            }
            
            Console.WriteLine(Int32.Parse(konacni));
        }
    }
}