#include<iostream>
using namespace std;
int main(){
    string a,b,c="";
    cin>>a>>b;
    int la=(int)a.length(),lb=(int)b.length();
    char x,y;
    for(int i=0;i<(int)max(la,lb);i++){
        x=a[la-1-i];y=b[lb-1-i];
        if(x==y)
            c=x+(x+c);
        else
            c=max(x,y)+c;
    }
    cout<<c<<endl;
    return 0;}