#include <iostream>

using namespace std;

int main()
{
    int x, y;
    cin >> x;cin >> y;
    int num = 0;
    int i = 0;
    while (x>0 && y>0)
    {
        int tmpx, tmpy;
        tmpx = x % 10;
        x /= 10;
        tmpy = y % 10;
        y /= 10;
        if (tmpx != tmpy)
        {
            num += max(tmpx, tmpy) * pow(10,i);
        }
        else
        {
            num += tmpx * pow(10,i);
            num += tmpy * pow(10, i + 1);
            i++;
        }
        i++;
    }
    if (x!=y)
    {
        cout << x + y << num;
    }
    else
    {
        cout << num;
    }
}