#include <bits/stdc++.h>
#define pb push_back

using namespace std;

string a1,b1;
vector<int> a,b,res;

int main()
{
    cin >> a1 >> b1;
    if(a1.size()<b1.size()) swap(a1,b1);
    for (auto u:a1){
        a.pb(u-'0');
    }
    for (auto u:b1){
        b.pb(u-'0');
    }
    reverse(b.begin(),b.end());
    reverse(a.begin(),a.end());
    for (int i=0; i<=a.size()-b.size()+1; i++){
        b.pb(-1);
    }
    for(int i=0; i<a.size(); i++){
        if(a[i]>=b[i]) res.pb(a[i]);
        if(b[i]>=a[i]) res.pb(b[i]);
    }
    for(int i=res.size()-1; i>=0; i--) cout << res[i];
}