#include <iostream>
#include <algorithm>

using namespace std;

unsigned short l( unsigned int x)
{
    unsigned short i = 0;
    while( x > 0 )
    {
        i ++;
        x /= 10;
    }return i;
}


int main()
{
    unsigned int x, y;
    unsigned long m = 0, d = 1;
    short i, p1, p2, k;
    cin >> x >> y;
    k = l(max(x,y));
    for ( i = 0; i < k; i ++ )
    {
        p1 = x % 10;
        p2 = y % 10;
        if ( p1 == p2 && p1 != 0)
        {
            m += p1 * 11 * d;
            d *= 10;
        }
        else
        {
            m += d * max(p1, p2);
        }
        d *= 10;
        x /= 10;
        y /= 10;
    }
    cout << m;
    return 0;
}