#include<iostream>
using namespace std;
void sudaranje(int a[], int x, int y)
{
	int i = 0;
	int xp, yp;
	while(x > 0 || y > 0)
	{
		if(x != 0)
		{
			xp = x%10;
		}
		else xp = -1;
		if(y != 0)
		{
		  yp = y%10;	
		}
		else yp = -1;
		if(xp > yp)
		{
			a[i] = xp;
			i++;
			
		}
		else if(xp < yp)
		{
			a[i] = yp;
			i++;
			
		}
		else if(xp == yp)
		{
			a[i] = yp;
			i++;
			a[i] = xp;
			i++;
		
		 }
		 x = x/10;
		 y = y/10;
	}
}
int sudariti(int x, int y)
{
	int br = -1;
	int xpp, ypp;
	while(x > 0 || y > 0)
	{
		if(x != 0)
		{
			xpp = x%10;
		}
		else xpp = -1;
		if(y != 0)
		{
		  ypp = y%10;	
		}
		else ypp = -1;
		if(xpp > ypp)
		{
			br++;
			
		}
		else if(xpp < ypp)
		{
			br++;

		}
		else if(xpp == ypp)
		{
			br++;
			br++;
		
		 }
		 x = x/10;
		 y = y/10;
	}
	return br;
}
int main()
{
	int x, y;
	int a[22];
	cin>>x;
	cin>>y;
	int xo, yo;
	xo = x;
	yo = y;
	int br;
	sudaranje(a, x, y);
	br = sudariti(xo, yo);
	for(int q = br; q>-1; q--)
	{
		cout<<a[q];
	}
}