#include <bits/stdc++.h>

using namespace std;

int main()
{
    string x,y,z="";
    cin>>x>>y;
    if(y.length()>x.length())swap(x,y);
    for(int i=x.length()-1,j=y.length()-1;i>=0;i--,j--)
    {
        char a=x[i],b='p';
        if(j>=0)b=y[j];
        if(b=='p')z=a+z;
        else
        {
            if(a>b) z=a+z;
            else if(a<b) z=b+z;
            else z=a+(b+z);
        }
    }
    cout<<z;
}