#include <iostream>

using namespace std;

int tenth(int n){
	int c = 1;
	while (n != 1){
		n--;
		c *= 10;
	}
}

int size(int n){
	int c = 0;
	while (n != 0){
		c++;
		n /= 10;
	}
	return c;
}

int main(){
	int x, y, maxsize;
	cin >> x >> y;
	
	if (size(x) > size(y)) maxsize = size(x);
	else maxsize = size(y);
	
	for (maxsize; maxsize != 0; maxsize--){
		if (x / tenth(maxsize) >= y / tenth(maxsize)) cout << x / tenth(maxsize);
		if (x / tenth(maxsize) <= y / tenth(maxsize)) cout << y / tenth(maxsize);
		x = x % tenth(maxsize);
		y = y % tenth(maxsize);
	}
}