using System;
using System.Collections.Generic;

namespace ConsoleApp3
{
    internal class Program
    {
        static void Main(string[] args)
        {


            int z = 0;
            int fn;
            int times;
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int lenx = x.ToString().Length;
            int leny = y.ToString().Length;
            List<int> xs = new List<int>() { };
            List<int> ys = new List<int>() { };
            fn = 0;
            for (int i = 0; i < lenx; i++)
            {
                int a = x % 10;
                xs.Add(a);
                x = (x - a) / 10;
            }
            for (int i = 0; i < leny; i++)
            {
                int a = y % 10;
                ys.Add(a);
                y = (y - a) / 10;
            }
            int cx = xs.Count;
            int cy = ys.Count;
            if (cx >= cy)
            {
                for (int i = 0; i < cy; i++)
                {
                    times = Convert.ToInt32(Math.Pow(10, z));

                    if (xs[i] > ys[i])
                    {
                        fn = fn + xs[i] * times;
                    }
                    if (xs[i] == ys[i])
                    {
                        fn = fn + xs[i] * times;
                        z++;
                        times = Convert.ToInt32(Math.Pow(10, z));
                        fn = fn + xs[i] * times;
                    }
                    if (xs[i] < ys[i])
                    {
                        fn = fn + ys[i] * times;
                    }
                    z++;
                }
                for (int g = cy; g < cx; g++)
                {
                    times = Convert.ToInt32(Math.Pow(10, z));
                    fn = fn + xs[g] * times;
                    z++;
                }
            }
            else
            {
                for (int i = 0; i < cx; i++)
                {
                    times = Convert.ToInt32(Math.Pow(10, z));

                    if (xs[i] > ys[i])
                    {
                        fn = fn + xs[i] * times;
                    }
                    if (xs[i] == ys[i])
                    {
                        fn = fn + xs[i] * times;
                        z++;
                        times = Convert.ToInt32(Math.Pow(10, z));
                        fn = fn + xs[i] * times;
                    }
                    if (xs[i] < ys[i])
                    {
                        fn = fn + ys[i] * times;
                    }
                    z++;
                }
                for (int g = cx; g < cy; g++)
                {
                    times = Convert.ToInt32(Math.Pow(10, z));
                    fn = fn + ys[g] * times;
                    z++;
                }
            }
            Console.WriteLine(fn);
        }
    }
}