#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main()
{
    unsigned long long a, b, tezina = 1, c = 0;
    cin >> a >> b;
    while (a != 0 || b != 0)
    {
        if (a % 10 > b % 10)
        {
            c += tezina * (a % 10);
        }
        else if (a % 10 == b % 10 && a != 0 && b != 0)
        {
            c += tezina * (a % 10);
            tezina *= 10;
            c += tezina * (b % 10);
        }
        else if (b % 10 > a % 10)
        {
            c += tezina * (b % 10);
        }
        a /= 10;
        b /= 10;
        tezina *= 10;
    }
    cout << c;
}