#include <iostream>

using namespace std;

int main()
{
    unsigned long long x,y;
    cin>>x>>y;
    unsigned long long r=0;
    int d=10;
    while(max(x,y)!=0)
    {
        if(x%10==y%10 && min(x,y)!=0)
        {
            r+=x%10*d/10+y%10*d;
            d*=10;
        }
        else
            r+=max(x%10,y%10)*d/10;
        //cout<<r<<endl;
        d*=10;
        x/=10;
        y/=10;
    }
    cout<<r;
    return 0;
}