#include<iostream>
using namespace std;
int sudaranje(int x, int y)
{
	int sud = 0;
	int i = 1;
	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)
		{
			sud = sud + i*xp;
			i = i*10;
		}
		else if(xp < yp)
		{
			sud = sud + i*yp;
			i = i*10;
		}
		else if(xp == yp)
		{
			sud = sud + i*xp; 
			i = i*10;
			sud = sud + i*yp;
			i = i*10;
		 }
		 x = x/10;
		 y = y/10;
	}
	return sud;
}
int main()
{
	int x, y;
	int sud;
	cin>>x;
	cin>>y;
	sud = sudaranje(x, y);
	cout<<sud;
	
}