#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll x, y;
    cin >> x >> y;

    ll mx = max(x, y), my = min(x, y);

    ll c = 0;
    ll i = 1;
    while(my) {
        ll cx = mx % 10, cy = my % 10;

        if (cx == cy) {
            c += i * cx;
            i *= 10;
            c += i * cy;
        } else {
            c += i * max(cx, cy);
        }

        mx /= 10;
        my /= 10;
        i *= 10;
    }

    while(mx) {
        c += (mx % 10) * i;
        i *= 10;
        mx /= 10;
    }

    cout << c;
}