#include<iostream>
#include<cmath>

using namespace std;

int main() {
	long long a, b;
	cin >> a >> b;
	
	long long c = 0;
	long long power = 1;

	while (a && b) {
		int bigger = a % 10 > b % 10 ? a % 10 : b % 10;

		c += power * bigger;
		power *= 10;

		if (a % 10 == b % 10) {
			c += power * bigger;
			power *= 10;
		};

		a /= 10;
		b /= 10;
	}

	while (a) {
		c += power * (a % 10);
		power *= 10;
		a /= 10;
	}

	while (b) {
		c += power * (b % 10);
		power *= 10;
		b /= 10;
	}

	cout << c;
}