#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define cy cout << "YES"<< endl;
#define cn cout << "NO"<< endl;
#define pf push_front
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>


void solve()
{
    string a,b; cin >> a >> b;
    string ans ="";
    int pom;
    int ab;
    if(a.length()>b.length())
    {
        pom = a.length()-b.length();
        b.insert(0,pom,'0');
        ab=1;
    }
    else if(a.length() < b.length())
    {
        pom = b.length()-a.length();
        a.insert(0,pom,'0');
        ab=0;
    }
    //cout << a << ' ' << b << endl;
    int xf=0;
    for(int i = 0; i < a.length(); i++)
    {
        if(ab==1 && b[i]!='0')
            xf++;
        else if(ab==0 && a[i]!='0')
            xf++;        
        if(xf)
        {
                if(a[i]-'0'>b[i]-'0')
                    ans+=a[i];
                else if(a[i]-'0'<b[i]-'0')
                    ans+=b[i];
                else
                {
                    ans += a[i];
                    ans += a[i];
                }
        }
        else
        {
            if(a[i]-'0'>b[i]-'0')
                ans+=a[i];
            else if(a[i]-'0'<b[i]-'0')
                ans+=b[i];
            else if(a[i]=='0' && b[i]=='0')
                ans+='0';
        }
    }
    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(nullptr);
 
    solve();
}