#include <bits/stdc++.h>

using namespace std;

int main() {
    unsigned a, b, c = 0;
    unsigned long long dekad = 1;
    cin >> a >> b;
    while(a > 0 || b > 0) {
        int c1 = a % 10, c2 = b % 10;
        if(c1 == c2 && (a != 0 && b != 0)) {
            c += dekad * c1;
            dekad *= 10;
            c += dekad * c2;
            dekad *= 10;
        }
        else {
            c += dekad * max(c1, c2);
            dekad *= 10;
        }
        a /= 10;
        b /= 10;
    }
    cout << c << endl;
    return 0;
}