#include <iostream>

using namespace std;

int main()
{
    long int x,y,z=0,c=1,cx,cy;
    cin >> x >> y;
    while (x!=0 && y!=0)
    {
        cx=x%10;
        cy=y%10;
        if (cx==cy)
        {
            z+=cy*c;
            c*=10;
        }
        cx=max(cx,cy);
        z+=cx*c;
        c*=10;
        x/=10;
        y/=10;
    }
    z+=(x+y)*c;
    cout << z;
    return 0;
}