#include <iostream>
#include <string>
#include <list>

using namespace std;

string NumberCrash(string X, string Y) {
    list<int> Z;
    int Min = min(X.length(), Y.length());
    int dif = X.length() - Y.length();

    char x, y;
    int i;
    for (i = 0; i < Min; i++) {
        x = X.back(); X.pop_back();
        y = Y.back(); Y.pop_back();

        if (x > y) {
            Z.push_front(x);
        }
        else if (x < y) {
            Z.push_front(y);
        }
        else
        {
            Z.push_front(x);
            Z.push_front(x);
        }
    }
    
    if (X.length() > Y.length()) {
        for(int i = abs(dif) - 1; i >= 0; i--)
            Z.push_front(X[i]);
    }
    else if (X.length() < Y.length()) {
        for (int i = abs(dif) - 1; i >= 0; i--)
            Z.push_front(Y[i]);
    }

    string S(Z.begin(), Z.end());
    return S;
}

int main()
{
    string X, Y;

    cin >> X;
    cin >> Y;

    cout << NumberCrash(X, Y);
}