#include <iostream>
#include <string>
using namespace std;
string x, y, p; int m, k, xx, yy; char slom[100];
int main()
{
    cin >> x >> y; xx = x.size(); yy = y.size(); m = max(xx, yy);
    if(xx < m)
        for(int i = 0; i < (yy - xx); i++)
            x = '.' + x;
    else if(yy < m)
        for(int i = 0; i < (xx - yy); i++)
            y = '.' + y;
    for(int i = m; i >= 0; i--)
    {
        if(x[i] > y[i])
            slom[k] = x[i];
        else if(y[i] > x[i])
            slom[k] = y[i];
        else if(x[i] == y[i])
        {
            slom[k] = x[i];
            k ++;
            slom[k] = x[i];
        }
        k ++;
    }
    for(int i = k; i >= 0; i--)
        cout << slom[i];
    cout << endl;
    
    return 0;
}