#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
	string a, b; cin >> a >> b;
	string s = "";
	int i = a.size() - 1, j = b.size() - 1;
	while (i >= 0 && j >= 0)
	{
		if (a[i] > b[j]) s = a[i] + s;
		else if (a[i] < b[j]) s = b[j] + s;
		else s = string(2, a[i]) + s;
		i--; j--;
	}
	if (a.size() > b.size()) s = a.substr(0, a.size() - b.size()) + s;
	else s = b.substr(0, b.size() - a.size()) + s;
	cout << s;
}