#include <iostream>
using namespace std;

int main()
{
    long x, y;
    cin >> x;
    cin >> y;

    long max = x, min = y;
    if (y > x)
    {
        max = y;
        min = x;
    }
    long suma = 0;
    int st = 1;
    while (max)
    {
        x = max % 10;
        y = min % 10;
        if (x > y)
        {
            suma += x * st;
        }
        else if(x<y)
        {
            suma += y * st;
        }
        else if(x==y && min!=0)
        {
            suma += x * st;
            st *= 10;
            suma += x * st;
        }
        else
        {
            suma += x * st;
        }

        st *= 10;
        max /= 10;
        min /= 10;
    }
    cout << suma << endl;
    return 0;
}