#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(y == 0 && pom1 == 0)
			{
				s += pow(10, br) * pom1;
			}
			
			else if(pom == pom1)
			{
				s+= pow(10, br) * pom1;
				s+= pow(10, br+1) * pom1;
				br++;
			}
			
			
			if(pom != pom1)
			{
				s += pow(10, br) * max(pom, pom1);
			}
			
			
			
			br++;			
		}
	}
	
	else
	{
		while(y > 0)
		{
			
			int pom = x % 10;
			x /= 10;
			
			int pom1 = y % 10;
			y /= 10;
			
			if(x == 0 && pom == 0)
			{
				s += pow(10, br) * pom;
			}
		
			else if(pom == pom1 && x != 0)
			{
				s+= pow(10, br) * pom1;
				s+= pow(10, br+1) * pom1;
				br++;
			}
			if(pom != pom1)
			{
				s += pow(10, br) * max(pom, pom1);
			}
			
			
			
			br++;			
		}
	}
	
	cout << s << endl;
	return 0;
	
}