#include <bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    string x, y, ans;

    cin >> x >> y;

    reverse(x.begin(), x.end());
    reverse(y.begin(), y.end());

    int i = 0;
    while(i < (int) x.size() && i < (int) y.size()){
        if(x[i] > y[i]) ans += x[i];
        else if(y[i] > x[i]) ans += y[i];
        else ans += x[i], ans += x[i];

        ++i;
    }

    while(i < (int) x.size()){
        ans += x[i++];
    }

    while(i < (int) y.size()){
        ans += y[i++];
    }

    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
    return 0;
}