#include <stdio.h>
#include <math.h>

int main()
{
int x;
int y;
scanf("%d", &x);
scanf("%d", &y);
int dx = x;
int dy = y;

int counter = 0;
if(x <= y)
{
	while(dy)
	{
		dy /= 10;
		counter++;
	}
}
else
{
	while(dx)
	{
		dx /= 10;
		counter++;
	}

}
int a = 0;
int power = 1;
int number = 0;
int check = 0;
while(a < counter)
{

	if(x%10 > y%10)
	{
		number += (x%10)*power;
	}
	if(x%10 < y%10)
	{
		number += (y%10)*power;
	}
	if(x == 0 || y == 0) check = 1;
	if(x%10 == y%10 && check == 0)
	{
		number += (x%10)*power;
		counter++;
		a++;
		power*=10;
		number += (x%10)*power;
	}
	a++;
	x /= 10;
	y /= 10;
	power *= 10;
	check = 0;
}
printf("%d\n", number);
return 0;
}