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


int main(int argc, char** argv) {
	long long x, y, s, b, p;
	int cx, cy;
	cin >> x >> y;
	s=x+y;
	y = min(x, y);
	x = s-y;
	b = 0;
	s = 0;
	p = 1;
	while(y>0)
	{
		cx = (int)x%10;
		cy = (int)y%10;
		if(cx>cy)
		{
			s+=cx*p;
			p*=10;
			x/=10;
			y/=10;
		}
		else
		{
			if(cx<cy)
			{
				s+=cy*p;
				p*=10;
				x/=10;
				y/=10;
			}
			else
			{
				s+=cx*p;
				p*=10;
				s+=cy*p;
				p*=10;
				x/=10;
				y/=10;
			}
		}
	}
	s+=x*p;
	cout << s << endl;
	return 0;
}