#include <iostream>
#include <string>
#include <cstdlib>
#include <iomanip>

using namespace std;

int main()
{
	string a,b,c="";
	cin >> a >> b;
	int duzinaA=a.size()-1,duzinaB=b.size()-1;
	if(duzinaA<duzinaB)
	{
		swap(a,b);
		swap(duzinaA,duzinaB);
	}
	for(int i=duzinaB,j=duzinaA;i>=0;i--)
	{
		//cout << a[j] << " ! " << b[i] << endl;
		if(a[j]==b[i])
		{
			c+=a[j];
			c+=a[j];
		}
		else{
			c+=max(a[j],b[i]);
		}
		j--;
		if(i==0)
		{
			while(j>=0)
			{
				c+=a[j];
				j--;
			}
		}
	}
	int duzinaC=c.size()-1;
	for(int i=duzinaC;i>=0;i--)
	{
		cout << c[i];
	}
	cout << endl;
	return 0;
}