#include <bits/stdc++.h>
using namespace std;
string x,y,s;
int br1,br2,n;
int main (){
    cin>>x>>y;
    for(int i=0; i<x.size(); i++)
        br1++;
    for(int i=0; i<y.size(); i++)
        br2++;
        //cout<<br1<<" "<<br2<<endl;
    if(br2>br1)swap(x,y);
    n=abs(br1-br2);
    for(int i=0; i<n; i++){
        s.push_back(x[i]);
    }
    for(int i=n,j=0; i<x.size(); i++,j++){
        if(x[i]>y[j])s.push_back(x[i]);
        else if(x[i]==y[j]){s.push_back(x[i]); s.push_back(x[i]);}
        else s.push_back(y[j]);
    }
       cout<<s<<endl;
return 0;
}