#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int x,y;
    unsigned long long s = 0, d = 1;
    cin>>x>>y;
    while(x>0||y>0){
        int cx = x%10;
        int cy = y%10;
        if(cx!=cy||x==0||y==0){
            s += d*max(cx,cy);
            d*=10;
        }
        else{
            s += d*max(cx,cy);
            d*=10;
            s += d*max(cx,cy);
            d*=10;
        }
        x/=10;
        y/=10;
    }
    cout<<s;
    return 0;
}