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

namespace ConsoleApp2
{
    internal class Program
    {
        static int formiraj (int x, int y)
        {
            int novBr = 0;
            int n1 = 0;
            int n2 = 0;
            int i = 1;
                while (x != 0 || y != 0)
                {
                    n1 = x % 10;
                    n2 = y % 10;
                    if (n1 > n2)
                    {
                        novBr += n1 * i;
                        i *= 10;
                        x /= 10;
                        y /= 10;
                    }
                    else if (n1 == n2)
                    {

                        novBr += n1 * i;
                        i *= 10;
                        novBr += n2 * i;
                        i *= 10;
                        x /= 10;
                        y /= 10;
                    }
                    else
                    {
                        novBr += n2 * i;
                        i *= 10;
                        x /= 10;
                        y /= 10;
                    }
                }
            
            return novBr;
        }
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());

            int Br = formiraj(x, y);
            Console.WriteLine(Br);
        }
    }