#include <iostream>
#include <cmath>

using namespace std;

int main() {
	long long int x, y, a = 0, x2, y2, x1, y1, b = 0;
	cin >> x >> y;
	for(int i = 0; i < 9; i++) {
		x2 = x / pow(10, i);
		y2 = y / pow(10, i);
		x1 = x2 % 10;
		y1 = y2 % 10;
		if(x1 > y1) {
			a += x1 * pow(10, i) * pow(10, b);
		}else if(y1 > x1) {
			a += y1 * pow(10, i) * pow(10, b);
		}else{
			a += ((x1 * pow(10, i)) + (y1*10 * pow(10, i))) * pow(10, b);
			b++;
		}
	}
	cout << a << endl;
	
	return 0;
}