#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	int x = 0, y = 0;
	cin >> x >> y;
	int x1 = int(log10(x) + 1), x2 = int(log10(y) + 1);
	int veci = 0, manji = 0;
	if (x1 > x2)
	{
		veci = x1;
		manji = x2;
	} else
	{
		veci = x2;
		manji = x1;
	}
	int ok = veci + manji;
	int res[ok];
	ok = 1;
	
	for (int i = 1; i <= veci; i++)
	{
		int del = pow(10, i);
		int cif1, cif2;
		if (i == 1)
		{
			cif1 = x % del;
			cif2 = y % del;
		} else {
			cif1 = x % del / pow(10, i - 1);
			cif2 = y % del / pow(10, i - 1);
		}
		if (cif1 > cif2)
		{
			res[veci + manji - ok] = cif1;
			ok++;
		} else if (cif2 > cif1)
		{
			res[veci + manji - ok] = cif2;
			ok++;
		} else
		{
			res[veci + manji - ok] = cif1;
			res[veci + manji - ok - 1] = cif2;
			ok += 2;
		}
	}
		for (int i = veci + manji - ok + 1; i < veci + manji; i++)
		{
			cout << res[i];
		}
	
}