#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    string x,y;
    
    cin >> x;
    cin >> y;
    
    reverse(x.begin(),x.end());
    reverse(y.begin(),y.end());
    
    int n=x.length(),m=y.length();
    
    string res="";
    
    for(int i=0; i<max(n,m); i++)
    {
        if(i>=n)
        {
            res+=y[i];
        }
        else if(i>=m)
        {
            res+=x[i];
        }
        else if(y[i]>x[i])
        {
            res+=y[i];
        }
        else if(y[i]==x[i])
        {
            res+=y[i];
            res+=x[i];
        }
        else if(x[i]>y[i])
        {
            res+=x[i];
        }
    }
    
    reverse(res.begin(),res.end());
    
    cout << res << endl;
    
    return 0;
}