#include <iostream>

using namespace std;

int main()
{
    unsigned int x, y, z;
    cin >> x ;
    cin >> y ;
    z = 0;
    unsigned int pom = 1;
    while(x!=0 || y!=0)
    {
        z = z + max(x%10, y%10)*pom;
        if((x%10 == y%10) && (y!=0 && x!=0))
        {
            pom = pom*10;
            z = z + (x%10)*pom;
        }
        x = x/10;
        y = y/10;
        pom = pom*10;
    }

    cout << z << endl;
    return 0;
}