using System;

class Program
{
    static void Main(string[] args)
    {
        long x = 0, y = 0, n = 0;
        x = long.Parse(Console.ReadLine());
        y = long.Parse(Console.ReadLine());

        int cifre1 = x.ToString().Length;
        int cifre2 = y.ToString().Length;
        int maxCifre = cifre1;
        if (cifre2 > cifre1)
            maxCifre = cifre2;

        int div = 1;
        for (int i = 1; i < maxCifre; i++)
        {
            div *= 10;
        }

        long xTemp, yTemp, cifra = 0;
        for (int i = 0; i < maxCifre; i++)
        {
            xTemp = (x / div) % 10;
            yTemp = (y / div) % 10;
            cifra = xTemp;

            if (xTemp == -1 || yTemp > xTemp)
                cifra = yTemp;
            else if (yTemp == -1 || xTemp > yTemp)
                cifra = xTemp;

            if (i > 0)
                n *= 10;
            n += cifra;

            if (yTemp == xTemp && xTemp != 0)
            {
                n *= 10;
                n += cifra;
            }
            div /= 10;
        }

        Console.WriteLine(n);
    }
}