#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    ll X, Y;
    cin >> X >> Y;
    ll ans = 0;
    ll p = 1;
    while (X > 0 || Y > 0)
    {
        ll c1 = X % 10;
        ll c2 = Y % 10;
        ll c = max(c1,c2);
        ans += p * c;
        p *= 10;
        if (c1 == c2 && X != 0 && Y != 0)
        {
            ans += p * c;
            p *= 10;
        }
        X /= 10;
        Y /= 10;
    }
    cout << ans;
}