#include <iostream>

using namespace std;

int main()
{
    int X,Y,cif1,cif2;
    long long int Z;
    cin >> X >> Y;
    Z=0;
    int K=1;
    while(X!=0 || Y!=0)
    {
        cif1=X%10;
        cif2=Y%10;
        Z+=max(cif1,cif2)*K;
        if(cif1==cif2)
        {
            if(X!=0 && Y!=0)
            {
               Z+=cif1*K*10;
               K*=10;
            }
        }
        K*=10;
        X/=10;
        Y/=10;
    }
    cout << Z;
}