#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a;
    string b;
    cin>>a>>b;
    reverse(a.begin(),a.end());
    reverse(b.begin(),b.end());
    string c="";
    int n=a.length();
    int m=b.length();
    for(int i=0;i<max(n,m);i++)
    {
        if(i>n-1)
        {
            c+=b[i];
        }
        else if(i>m-1)
        {
            c+=a[i];
        }
        else if(a[i]==b[i])
        {
            c+=a[i];
            c+=b[i];
        }
        else if(a[i]-'0'>b[i]-'0')
        {
            c+=a[i];
        }
        else 
        {
            c+=b[i];
        }
    }
    int len=c.length();
    for(int i=len-1;i>=0;i--) cout<<c[i];
    cout<<endl;
    return 0;
}