#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long int x,y,rez=0;
    scanf("%lld%lld",&x,&y);
    for(;x>0||y>0;x/=10,y/=10)
    {
        rez=rez*10+max(x%10,y%10);
        if(x%10==y%10&&(x!=0||y!=0)) rez=rez*10+x%10;
    }
    printf("%lld",rez);
    return 0;
}