#include <iostream>

using namespace std;

int main()
{
    string a, b;
    cin >> a >> b;
    string c = "";
    int i = a.length() - 1;
    int j = b.length() - 1;
    while (i >= 0 && j >= 0) {
        if (a[i] > b[j])c = a[i] + c;
        else if (b[j] > a[i])c = b[j] + c;
        else c = a[i] + (a[i] + c);
        i--;
        j--;
    }
    while (i >= 0) {
        c = a[i] + c;
        i--;
    }
    while (j >= 0) {
        c = b[j] + c;
        j--;
    }
    cout << c;
}