#include <iostream>
#include <math.h>
using namespace std;

int main()
{
	unsigned long long x, y, ct = 0;
	unsigned long long z = 0;
	cin >> x >> y;
	while (x || y){
		if (x % 10 == y % 10 && (y != 0 && x != 0))
		{
			z = (unsigned long long)(z + (x % 10) * pow(10, ct + 1) + (x % 10) * pow(10, ct));
			ct++;
		}
		else
			z = (unsigned long long)(z + max(x % 10, y % 10) * pow(10, ct));
		x /= 10; y /= 10;
		ct++;
	}
	cout << z;
}