#include <bits/stdc++.h>
using namespace std;

int main() {
	long long x;
	long long y;
	cin >> x >> y;
	int xc, yc;
	deque<int> redx;
	deque<int> redy;
	while (x > 0)
	{
    	xc = x % 10;
    	x /= 10;
    	redx.push_front(xc);
	}
	while (y > 0)
	{
    	int yc = y % 10;
    	y /= 10;
    	redy.push_front(yc);
	}
	while(redx.size() != redy.size()) {
		if(redx.size() > redy.size()) redy.push_front(0);
		else redx.push_front(0);
	}
	while(!redx.empty() and !redy.empty()) {
		if(redx.front() > redy.front()) cout << redx.front();
		else if(redx.front() < redy.front()) cout << redy.front();
		else if(redx.front() == redy.front())
			if(redx.front() == 0 and redy.front() == 0) cout << 0;
			else cout << redx.front() << redy.front();
		redx.pop_front();
		redy.pop_front();
	}
	return 0;
}