using System;

class Program
{
    static void Main()
    {
        string X = Console.ReadLine();
        string Y = Console.ReadLine();
        if (X.Length > Y.Length)
        {
            for(int i = Y.Length; i <= X.Length; i++)
            {
                Y = String.Concat("-", Y);
            }
        }
        else
        {
            for(int i = X.Length; i <= Y.Length; i++)
            {
                X = String.Concat("-", X);
            }
        }
        string Z = "";
        while (X != "" && Y != "")
        {
            if (X[X.Length - 1] >= Y[Y.Length - 1])
            {
                Z = string.Concat(X[X.Length - 1], Z);
            }
            if (X[X.Length - 1] <= Y[Y.Length - 1])
            {
                Z = string.Concat(Y[Y.Length - 1], Z);
            }
            X = X.Remove(X.Length - 1);
            Y = Y.Remove(Y.Length - 1);
        }
        Console.WriteLine(Z);
        Console.ReadLine();
    }
}