using System;

namespace SudarBrojeva {
    class Program {

        static void Main(string[] args) {

            int X = int.Parse(Console.ReadLine());
            int Y = int.Parse(Console.ReadLine());

            string Xs = Convert.ToString(X);
            string Ys = Convert.ToString(Y);

            int Ysl = Ys.Length;
            int Xsl = Xs.Length;

            string izls = "";

            if (Xsl > Ysl) {

                izls += Xs.Substring(0, Xsl - Ysl);
                Xs = Xs.Substring(Xsl - Ysl);
                Xsl = Xs.Length;
            
            }

            else if (Xsl < Ysl) {

                izls += Ys.Substring(0, Ysl - Xsl);
                Ys = Ys.Substring(Ysl - Xsl);
                Ysl = Ys.Length;

            }

            char xi, yi;

            for (int i = 0; i < Xsl; i++) {

                xi = Xs[i];
                yi = Ys[i];

                izls += (xi == yi) ? xi + "" + xi :

                       ((xi > yi) ? xi : yi);

            }

            int izl = int.Parse(izls);

            Console.WriteLine(izl);

        }
    
    
    }

}