#include <iostream>

using namespace std;

int main()
{
    int x;
    int y;

    cin >> x >> y;

    int manji = min(x,y);

    long long res = 0;
    int mp = 1, c1, c2;

    while(manji > 0)
    {
        c1 = x % 10;
        x /= 10;
        c2 = y % 10;
        y /= 10;
        manji /= 10;
        if(c1 > c2)
        {
            res += c1 * mp;
            mp *= 10;
        }
        else if(c1 < c2)
        {
            res += c2 * mp;
            mp *= 10;
        }
        else
        {
            res += c1 * mp;
            mp *= 10;
            res += c2 * mp;
            mp *= 10;
        }
    }

    int veci = max(x,y);
    while(veci > 0)
    {
        res += veci * mp;
        mp *= 10;
        veci /= 10;
    }

    cout << res;
    return 0;
}