#include <iostream>
#include <cmath>
#include <string>


using namespace std;


char answ[1000];


int main()
{
    string s1, s2;
    cin>>s1>>s2;
    int i=s1.size()-1, j=s2.size()-1;
    int k=0;
    while(i>=0 && j>=0)
    {
        if(s1[i]==s2[j])
        {
            answ[k]=s1[i];
            k++;
            answ[k]=s2[j];
            k++;
        }
        else
        {
            answ[k]=max(s1[i], s2[j]);
            k++;
        }
        i--;
        j--;
    }
    while(i>=0)
    {
        answ[k]=s1[i];
        k++;
        i--;
    }
    while(j>=0)
    {
        answ[k]=s2[j];
        k++;
        j--;
    }
    for(int i=k-1; i>=0; i--)
    {
        cout<<answ[i];
    }
}