#include <iostream>
using namespace std;

using int64 = int64_t;

int main()
{
	int64 x, y;

	cin >> x >> y;

	int64 r = 0;
	int64 st = 1;
	while (x != 0 && y != 0)
	{
		int64 xc = x % 10;
		int64 yc = y % 10;

		if (xc == yc)
		{
			r += xc * 11 * st;
			st *= 100;
		}
		else
		{
			r += max(xc, yc) * st;
			st *= 10;
		}

		x /= 10;
		y /= 10;
	}

	if (y != 0)
		x = y;

	r += st * x;

	cout << r;
	
	return 0;
}