#include <bits/stdc++.h>
using namespace std;
long long bc (long long a)
{
    long long r = 0;
    while (a > 0)
    {
        r++;
        a = a / 10;
    }
    return r;
}
int main()
{
    long long x, y, k = 0, i, r = 0, a, b;
    cin >> x >> y;
    long long p = min(bc(x), bc(y));
    for (i = 0; i < p; i++)
    {
        a = x % 10;
        b = y % 10;
        x = x/10;
        y = y/10;
        if (a != b)
        {
            r += pow(10,k)*max(a,b);
            k++;
        }
        else
        {
            r += pow(10,k)*a + pow(10,k+1)*a;
            k += 2;
        }
    }
    r += (x+y)*pow(10,k);
    cout << r;
    return 0;
}