using System;

namespace sudar_brojeva
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int min = 0;
            int max = 0;    
            if (x < y)
            {
                min = x;
                max = y;
            }
            else
            {
                min = y;
                max = x;
            }
            int s = 0;
            while (max > 0)
            {
                s++;
                max /= 10;
            }
            int []a=new int[1000];
            for (int i = 0; i < s; i++)
            {
                if (x % 10 > y % 10)
                {
                    a[i] = x % 10;
                }
                else if (x % 10 < y % 10)
                {
                    a[i] = y%10;
                }
                else
                {
                    if(x!=0 && y != 0)
                    {
                        a[i] = y % 10;
                        a[i+1]= x % 10;
                        i++;
                        s++;
                    }                    
                }
                x /= 10;
                y /= 10;
            }
            for(int i = s-1; i >=0; i--)
            {
                Console.Write(a[i]);    
            }
            Console.ReadLine();
        }
    }
}