#include<iostream>
#include<cmath>
using namespace std;
main(){
int x, y, z=0, s=1;
cin >> x >> y;
while(x > 0|| y > 0){
    if(x%10>y%10) z+=s*(x%10);
    else z+=s*(y%10);
    x/=10; y/=10; s*=10;
}
cout<< z;
}