#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
 
int main() {
	unsigned long long a,b;
	int i,size;
	cin >> a >> b;
 
	if (a>=b) 
	size = trunc(log10(a)) + 1;
	else 
	size = trunc(log10(b)) + 1;
 
	vector<int> broj;
 
	for (i = 0 ; i < size ; i++)
	{
		int a1= a %10;
		int b1 = b %10;
		if (a1>b1) broj.push_back(a1);
		else if (a1<b1) broj.push_back(b1);
		else if ((a>0) && (b>0)){broj.push_back(a1); broj.push_back(b1);}
		else if ((a>0) && (b==0))broj.push_back(a1);
		else broj.push_back(b1);
		a = a/10; 
		b = b/10; 
	}
 
 
	for (i = broj.size()-1; i >= 0; i--) 
            cout << broj[i];
 
 
	return 0;
}