#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(-1);
		else redx.push_front(-1);
	}
	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()) cout << redx.front() << redy.front();
		else if(redx.front() == -1 or redy.front() == -1) cout << 0;
		redx.pop_front();
		redy.pop_front();
	}
	return 0;
}