#include <bits/stdc++.h>

#define ll unsigned long long

using namespace std;

int main() {

    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);

    ll x, y;
    cin >> x >> y;
    if(x < y)
        swap(x, y);
    
    ll p = 1, ans = 0;
    while(x > 0) {
        ll c1 = x % 10;
        x /= 10;

        if(y == 0) {
            ans += p * c1, p *= 10;
            continue;
        }
        ll c2 = y % 10;
        y /= 10;

        if(c1 >= c2)
            ans += p * c1, p *= 10;
        if(c2 >= c1)
            ans += p * c2, p *= 10;
    }
    cout << ans << endl;
    return 0;
}