#include <iostream>
#include <math.h>

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(){
	long long int r = 0;
	int x, y, maxsize, xcif, ycif;
	cin >> x >> y;
	
	if (size(x) > size(y)) maxsize = size(x);
	else maxsize = size(y);
	
	for (maxsize; maxsize != 0; maxsize--){
		xcif = x / tenth(maxsize);
		ycif = y / tenth(maxsize);
		if (xcif >= ycif){
			r *= 10;
			r += xcif;
		}
		if (xcif <= ycif){
			r *= 10;
			r += ycif;
		}
		x = x % tenth(maxsize);
		y = y % tenth(maxsize);
	}
	cout << r;
}