#include <bits/stdc++.h>

using namespace std;
#define ll long long
int main()
{
    int a, b;
    cin >> a >> b;
    int i = 0;
    ll ans = 0;
    while (a > 0 && b > 0)
    {
        int pa = a % 10;
        int pb = b % 10;
        if (pa == pb)
        {
            ans += pb * pow(10, i);
            i++;
        }
        int mx = max(pa, pb);
        ans += mx * pow(10, i);
        i++;
        a /= 10;
        b /= 10;
    }
    if (b > 0 || a > 0)
    ans += (b + a) * pow(10, i);
    cout << ans;
    return 0;
}