using System.Diagnostics;
using System.Diagnostics.Metrics;
namespace takmicenje
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());
            int max = a;
            int c = 0;
            if (max > b)
            {
                max = max;
            }
            else {
                max = b;
            }
            while (max > 0) {
              max =  max / 10;
                c++;
            }
           
            static int MaksimalanBr(int a,int b) 
            
            {
                if (a > b)
                {
                    return a;
                }
                else {
                    return b;
                }
            }
            for (int i = c; i > 0; i--)
            {
                if (i == c)

                {
                    int x1 = a / (int)Math.Pow(10, (c - 1));
                    int y1 = b / (int)Math.Pow(10, (c - 1));
                    Console.Write(MaksimalanBr(x1, y1));
                }

                else if (i - 1 == 0)

                {
                    int x = a % 10;
                    int y = b % 10;
                    Console.Write(MaksimalanBr(x, y));
                }
                else{
                    int x2 = (a % (int)Math.Pow(10, i)) / (int)Math.Pow(10, (i - 1));
                    int y2 = (b % (int)Math.Pow(10, i)) / (int)Math.Pow(10, (i - 1));
                    Console.Write(MaksimalanBr(x2, y2));
                }
                
            }
           
           
        }
    }
}