#include <iostream>
#include <vector>
using namespace std;
int main() {
    cin.tie(NULL);
    ios::sync_with_stdio(false);
    string a, b;
    cin >> a >> b;
    int c = min(a.length(), b.length());
    vector<char> d;
    for (int i = 1; i <= c; i++) {
        if (a[a.length() - i] == b[b.length() - i]) {
            d.push_back(a[a.length() - i]);
            d.push_back(a[a.length() - i]);
            continue;
        } 
        d.push_back(max(a[a.length() - i], b[b.length() - i]));
    }
    if (a.length() > b.length()) for (int i = c + 1; i <= a.length(); i++) d.push_back(a[a.length() - i]);
    else if (a.length() < b.length()) for (int i = c + 1; i <= b.length(); i++) d.push_back(b[b.length() - i]);
    for (int i = d.size() - 1; i >= 0; i--) cout << d[i];
}