#include <iostream>
#include <cmath>

using namespace std;

int newNum(int n1, int n2, int digit)
{
    if(n1 == 0) n1 = -1;
    if(n2 == 0) n2 = -1;
    if(n1 == -1 && n2 == -1)
    {
        return 0;
    }
    else
    {
        int n11 = n1%10;
        int n21 = n2%10;
        if(n11 == n21)
        {
            return newNum(n1 / 10, n2 / 10, digit + 2) + n11 * pow(10, digit) + n21 * pow(10, digit + 1);
        }
        else if(n11 > n21)
        {
            return newNum(n1 / 10, n2 / 10, digit + 1) + n11 * pow(10, digit);
        }
        else if(n21 > n11)
        {
            return newNum(n1 / 10, n2 / 10, digit + 1) + n21 * pow(10, digit);
        }
    }

}

int main()
{
    int n1, n2;
    cin >> n1 >> n2;
    cout << newNum(n1, n2, 0);
    return 0;
}