#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int x, y;
	cin >> x >> y;
	
	long long s = 0;
	int br = 0;
	
	if(x > y)
	{
		while(x > 0)
		{
			int pom = x % 10;
			x /= 10;
			
			int pom1 = y % 10;
			y /= 10;
			
			if(pom != pom1)
			{
				s += pow(10, br) * max(pom, pom1);
			}
			
			else
			{
				s+= pow(10, br) * pom;
				s+= pow(10, br+1) * pom;
				br++;
			}
			
			br++;			
		}
	}
	
	else
	{
		while(y > 0)
		{
			int pom = x % 10;
			x /= 10;
			
			int pom1 = y % 10;
			y /= 10;
			
			if(pom != pom1)
			{
				s += pow(10, br) * max(pom, pom1);
			}
			
			else
			{
				s+= pow(10, br) * pom;
				s+= pow(10, br+1) * pom;
				br++;
			}
			
			br++;			
		}
	}
	
	cout << s;
	return 0;
	
}