#include<bits/stdc++.h>
using namespace std;
string a,b,c;
int a1,b1,k;
int main (){
    cin>>a>>b;
    if (b.size()>a.size()){
        c=b;
        b=a;
        a=c;
    }
   a1=a.size()-b.size();
    if (a1>=0){
            a1=a1-(2*a1);
        for (int i=0;i<a.size();i++){
            if(b[i+a1]==a[i]){
                 k=0;
                k=a[i]-48;
                k=k*10+k;
                cout<<k;
                if (a[i]-48==0){
                        cout<<k;
                    }
                continue;
            }
            if (a[i]<b[i+a1]){
                a[i]=b[i+a1];
            }
            cout<<a[i];
        }
    }

return 0;
}