#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int x,y;
    cin>>x;
    cin>>y;
    unsigned long long a=0;
    int brojac=0;
    while(x!=0 || y!=0){
    int xp=x%10;
    int yp=y%10;
        if(xp==yp && xp!=0){
            a=a+((xp)*pow(10,brojac));
            brojac++;
            a=a+((xp)*pow(10,brojac));
        }
        else{
        a= a + (max(xp,yp)*pow(10,brojac));
    }
        x=x/10;
        y=y/10;
        brojac++;
    }
    cout<<a<<endl;
    return 0;
}