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