#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double dbl;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector <string> vs;
const int inf = 1e9 + 5;
#define FAST ios::sync_with_stdio(false); cin.tie(0);
#define MAX INT_MAX
#define MIN INT_MIN
#define potato 0
#define lomljenje break

/*
#define A first
#define B second
#define PB push_back
#define MP make_pair
*/

int main()
{
    FAST

    string a, b;
    string s = "";
    cin >> a >> b;
    int k1 = a.size() - 1;
    int k2 = b.size() - 1;
    while(k1 >= 0 || k2 >= 0)
    {
        if(k1 < 0) s += b[k2];
        else if(k2 < 0) s += a[k1];
        else if(a[k1] != b[k2]) s += max(a[k1], b[k2]);
        else
        {
            s += a[k1];
            s += a[k1];
        }
        --k1;
        --k2;
    }
    reverse(s.begin(), s.end());
    cout << s;
    return potato;
}