#include <bits/stdc++.h>

using namespace std;

int main()
{
    int x,y,c1,c2;
    unsigned long long res=0,pom=1;
    cin>>x>>y;
    while(max(x,y)>0)
    {
        c1=x%10;
        c2=y%10;
        if(c1==c2)
        {
            res+=c1*pom;
            pom*=10;
            res+=c2*pom;
        }
        else
        {
            res+=max(c1,c2)*pom;
            pom*=10;
        }
        x/=10;
        y/=10;
    }
    cout << res<< endl;
    return 0;
}