using System;

namespace _1._takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            long x =int.Parse( Console.ReadLine());
            long y = int.Parse(Console.ReadLine());
            long nb = 0;
            long br = 1;
            long max = Math.Max(x, y);
     
            while ( max > 0)
            {
                if (Math.Min(x, y) == 0)
                {
                    nb = nb + Math.Max(x, y) * br;
                    break;
                }
                if (x % 10 != y % 10)
                {
                    long dod = Math.Max(x % 10, y % 10);
                    nb =nb + dod * br;
                    x = x / 10;
                    y = y / 10;
                    br = br * 10;
                    max=max / 10;
                }
                else
                {
                    nb  =nb+ (long)(x % 10) * br + (long)(x % 10) * (br * 10);
                    br = br * 100;
                    x = x / 10;
                    y = y / 10;
                    max = max / 10;
                }
            }   
            Console.WriteLine(nb);
        }
    }
}