#include <iostream>
using namespace std;
int main(){
	int x,y;
	int novibr = 0;
	
	int i=1;
	
	cin >> x >> y;
	
	while(x>0 && y>0){
		if(x%10>y%10)
			novibr += x%10*i;
		else if(x%10<y%10){
			novibr += y%10*i;
		}
			
		else{
			novibr += x%10*11*i;
			i*=10;
		}

		x/=10;
		y/=10;
		
		i*=10;
	}
	
	if(x==0)
		novibr += y*i;
	
	else if(y==0)
		novibr += x*i;
	
	
	cout << novibr;
	
}