#include <bits/stdc++.h>
using namespace std;
    string x,y,s,s1;
    int a,b;
int main(){
    cin >> x >> y;
    a=x.size();
    b=y.size();
    if(a>b){
        s1=x;
        x=y;
        y=s1;
    }
    reverse(x.begin(),x.end());
    for(int i=0; i<b-a; i++){
        x.push_back('.');
    }
    reverse(x.begin(),x.end());
    for(int i=0; i<=b; i++){
        if(x[i]>y[i]){s+=x[i];}
        else if(x[i]==y[i]){s+=x[i]; s+=x[i];}
        else if(x[i]<y[i]){s+=y[i];}
    }
    for(int i=0; i<=b; i++){
        cout << s[i];
    }
    cout << endl;
    return 0;
}