#include <iostream>
#define forn(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll a,b,c=0,e=1;
    ll c1, c2;
    cin >> a >> b;
    while (a > 0 || b > 0) {
        c1 = a % 10;
        c2 = b % 10;
        if (a == 0) c = c + e * c2, e *= 10;
        else if (b == 0) c = c + e * c1, e *= 10;
        else {
            if (c1 >= c2) c = c + e * c1, e *= 10;
            if (c2 >= c1) c = c + e * c2, e *= 10;
        }
        a /= 10, b /= 10;
    }
    cout << c << endl;
}