#include <bits/stdc++.h>

using namespace std;

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