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

namespace Takmicenje
{
    internal class Program
    {   
        static int poredi(int a,int b)
        {
            if(a>b)
            {
                return a;
            }
            else if(b>a)
            {
                return b;
            }
            else
            {
                return -1 ;
            }
        }
        static int sudar(int a, int b)
        {
            int a1, b1, p = 0, k = 1; ;
            while(a!=0|| b!=0)
            {
                a1 = a % 10;
                b1 = b % 10;
                if(a==0)
                {
                    p += b1 * k;
                    k *= 10;
                }
                else if(b==0)
                {
                    p += a1 * k;
                    k *= 10;
                }
                else if (poredi(a1, b1) == -1)
                {
                    p += a1 * k;
                    k *= 10;
                    p += b1 * k;
                    k *= 10;
                }
                else
                {
                    p += poredi(a1, b1) * k;
                    k *= 10;
                }
                a /= 10;
                b /= 10;
            }
            return p;
        }
        static void Main(string[] args)
        {
            int a= int.Parse(Console.ReadLine());
            int b= int.Parse(Console.ReadLine());
            Console.WriteLine(sudar(a, b));
        }
    }
}