#include<iostream>
#include<string>

using namespace std;

int main() {
	int a, b, c = 0, br = 1;
	cin >> a >> b;
	while (true) {
		if (a < 1 && b < 1)
			break;
		if (a < 1) {
			c += b * br;
			break;
		}
		if (b < 1) {
			c += a * br;
			break;
		}
		int q = a % 10;
		int s = b % 10;
		if (q == s) {
			int t = q * br;
			br *= 10;
			t += s * br;
			br *= 10;
			c += t;
		}
		else if (q > s) {
			c += q * br;
			br *= 10;
		}
		else {
			c += s * br;
			br *= 10;
		}
		a /= 10;
		b /= 10;
	}
	cout << c;
}