#include <iostream>

using namespace std;

int main()
{
    int x;
    int y;
    cin >> x;
    cin >> y;

    int cifx = 0;
    int xcopy = x;
    int cify = 0;
    int ycopy = y;

    while(xcopy%1000000000 != 0) {
        xcopy = xcopy / 10;
        cifx = cifx + 1;
    }

    while(ycopy%1000000000 != 0) {
        ycopy = ycopy / 10;
        cify = cify + 1;
    }




    if(cifx > cify) {
        while(cifx != cify) {
            y*10;
            cify++;
        }
    }

    else if(cify > cifx) {
        while(cifx != cify) {
            x*10;
            cifx++;
        }
    }




    int nbroj = 0;
    int counter = 1;

    while(x%1000000000 != 0 || y%10000000000 != 0)
    {
        if(x%10 > y%10) nbroj = nbroj + (x%10 * counter);
        else if(y&10 > x%10) nbroj = nbroj + (y%10 * counter);
        else nbroj = nbroj + (x%10 * counter);
        x = x/10;
        y = y/10;
        counter = counter * 10;
    }

    cout << nbroj << endl;

    return 0;
}