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


int main(int argc, char** argv) {
	int a,b,c,d,f,x[10000],y[10000],x1,y1,x2,y2;
	cin >> x1 >> y1;
	f = 0;
	d = 0;
	a = 0;
	while(x1>0)
	{
		x[f]=x1%10;
		x1 = x1/10;
		f++;
	}
	while(y1>0)
	{
		y[d] = y1%10;
		y1 = y1/10;
		d++;
	}
	if(f>d)
	{
		a = f;
		b = d;
		c = a-b;
	}
	else if(d>f)
	{
		a = d;
		b = f;
		
	}
	else
	{
		a = f;
		a = a-1;
	}
	
	for(int i = a; i>=0; i--)
	{
		if(x[i]>y[i])
		{
			cout << x[i];
		}
		else if(x[i]<y[i])
		{
			cout << y[i];
		}
		else if(b>=i)
		{
			
			cout << x[i] << y[i];
		}
		
	}
	
	
	
		
	return 0;
}