#include <iostream>

using namespace std;

int main()
{
    unsigned long long x, y;
    cin >> x >> y;
    unsigned long long broj = 0;
    unsigned long long k = 1;
    while(x > 0 && y > 0)
    {
        int c1 = x%10;
        int c2 = y%10;
        if(c1 > c2)
        {
            broj+=c1*k;
        }
        else if(c1 < c2)
        {
            broj+=c2*k;
        }
        else
        {
            broj+=c1*k;
            k*=10;
            broj+=c1*k;
        }
        k*=10;
        x/=10;
        y/=10;
    }
    broj+=(x+y)*k;
    cout << broj;

    return 0;
}