using System;
using System.Collections.Generic;
namespace SudarBrojeva
{
    class Program
    {
        static List<char> NovoNastali(long x, long y)
        {
            List<char> c = new List<char>();
            string s1 = x.ToString();
            string s2 = y.ToString();

            int n = s2.Length;
            if (s1.Length > s2.Length)
            {
                n = s1.Length;
            }

            if (s2.Length == s1.Length)//jednak broj cifara
            {
                for (int i = 0; i < n; i++)
                {
                    if (s1[i] > s2[i])
                        c.Add(s1[i]);
                    else if (s1[i] == s2[i])
                    {
                        c.Add(s1[i]);
                        c.Add(s1[i]);
                    }

                    else
                        c.Add(s2[i]);
                }
            }



            if (s1.Length > s2.Length)// prvi veci od drugog
            {

                int raz = s1.Length - s2.Length;
                for (int i = 0; i < raz; i++)
                {
                    c.Add(s1[i]);
                }

                for (int i = raz; i < s1.Length; i++)
                {
                    if (s1[i] > s2[i - raz])
                    {
                        c.Add(s1[i]);
                    }
                    if (s1[i] == s2[i - raz])
                    {
                        c.Add(s1[i]);
                        c.Add(s1[i]);
                    }
                    else if (s2[i - raz] > s1[i])
                    {
                        c.Add(s2[i - raz]);
                    }
                }



            }

            if (s2.Length > s1.Length)//drugi veci od prvog
            {

                int raz = s2.Length - s1.Length;
                for (int i = 0; i < raz; i++)
                {
                    c.Add(s2[i]);
                }

                for (int i = raz; i < s2.Length; i++)
                {
                    if (s2[i] < s1[i - raz])
                    {
                        c.Add(s1[i-raz]);
                    }
                    if (s2[i] == s1[i - raz])
                    {
                        c.Add(s2[i]);
                        c.Add(s2[i]);
                    }
                    else if (s2[i] > s1[i-raz])
                    {
                        c.Add(s2[i]);
                    }
                }


            }

            return c;

        }

        static void Main(string[] args)
        {
            long x = long.Parse(Console.ReadLine());
            long y = long.Parse(Console.ReadLine());
            List<char> c = NovoNastali(x, y);

            //Console.WriteLine(NovoNastali(x, y));
            foreach (var p in c)
            {
                Console.Write(p);
            }


        }
    }
}