#include <bits/stdc++.h>

using namespace std;

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

    if (x < y) swap(x, y);
    int m, n;

    int dig;
    int z = x;
    do
    {
        z /= 10; dig++;
    }
    while (z != 0);

    //int sudar[dig];
    int sudarbr;

    /*
    for (int i = dig - 1; i >= 0; i--)
    {
        m = x%10; n = y%10;
        if (y == 0 || m > n) sudar[i] = m;
        else if (m == n) sudar[i] = m*10+n;
        else sudar[i] = n;
        x /= 10; y /= 10;
    }

    for (int j = 0; j < dig; j++)
        cout << sudar[j];
    */

    for (int i = 0; i < dig; i++)
    {
        m = x%10; n = y%10;
        int a = pow(10,i);
        if (y == 0 || m > n) sudarbr += m * a);
        else if (m == n) sudarbr += (m * 10 + n) * a;
        else sudarbr += n * a;
        x /= 10; y /= 10;
    }

    cout << sudarbr;

    return 0;
}