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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 0 , br = 1;
            int x = Convert.ToInt32(Console.ReadLine());
            int x = Convert.ToInt32(Console.ReadLine());
            while (x > 0 || y > 0)
            {
                if(x % 10 > y % 10)
                {
                    n += (x % 10) * br;
                    br *= 10;
                    x /= 10;
                    y /= 10;
                }
                if(x % 10 == y % 10)
                {
                    n += (x % 10) * br;
                    br *= 10;
                    n += (y % 10) * br;
                    br *= 10;
                    x /= 10;
                    y /= 10;
                }
                if (x % 10 < y % 10)
                {
                    n += (y % 10) * br;
                    br *= 10;
                    x /= 10;
                    y /= 10;
                }
            }
            Console.WriteLine(n);
        }
    }
}