using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x = Convert.ToInt32(Console.ReadLine());
            int y = Convert.ToInt32(Console.ReadLine());
            int nx = 0;
            int ny = 0;
            int bx=0;
            int by=0;
            int xy = 0;
            
            List<int> xl = new List<int>();
            List<int> yl = new List<int>();
            while (x > 0)
            {
                nx = x % 10;
                x = x / 10;
                xl.Add(nx);
                bx++;
            }
            while (y > 0)
            {
                ny = y % 10;
                y = y / 10;
                yl.Add(ny);
                by++;
            }
            for (int i = (Math.Max(by,bx)-1); i >= 0; i--)
            {
                if (i >= by)
                {
                    for (int a = i - (by); a >= 0; a--)
                    {
                        yl.Insert(i-a, 0);
                    }
                    if (yl[i] == xl[i] && yl[i]!=0)
                    {
                        xy = (xy * 10 + yl[i]) * 10 + xl[i];
                    }
                    else
                    {
                        xy = xy * 10 + Math.Max(yl[i], xl[i]);
                    }
                }
                else if (i >= bx)
                {
                    for (int a = i - (bx); a >= 0; a--)
                    {
                        xl.Insert(i-a, 0);
                    }
                    if (yl[i] == xl[i] && yl[i] != 0)
                    {
                        xy = (xy * 10 + yl[i]) * 10 + xl[i];
                    }
                    else
                    {
                        xy = xy * 10 + Math.Max(yl[i], xl[i]);
                    }
                }
                else
                {
                    if (yl[i] == xl[i] && yl[i] != 0)
                    {
                        xy = (xy * 10 + yl[i]) * 10 + xl[i];
                    }
                    else
                    {
                        xy = xy * 10 + Math.Max(yl[i], xl[i]);
                    }
                }
            }
            Console.WriteLine(xy);
            Console.ReadLine();
            
            
            


        }
    }
}