#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    long long x, y;
    long long br=0;
    long long p=1;
    cin>>x>>y;
    while(max(x, y)>0){
		else if(x%10>y%10){
            br=br+(x%10)*p;
        }else if(x%10==y%10){
			br=br+(x%10*10+y%10)*p;
        	p*=10;
		}else if(x%10<y%10){
			br=br+(y%10)*p;
		}
		x=x/10;
		y=y/10;
		p*=10;
    }
    cout << br << endl;
}