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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int x, y, xx, yy;
	xx = 1;
	yy = 1;
	cin >> x >> y;
	while(x / xx > 0){
		xx *= 10;
	}
	xx /= 10;
	while(y / yy > 0){
		yy *= 10;
    }
    yy /= 10;
    if (xx > yy){
    	while (xx > yy){
    		cout << x / xx % 10;
    		xx /= 10;
		}
	}
	else if (yy > xx){
		while (yy > xx){
			cout <<  y / yy % 10;
			yy /= 10;
		}
	}
	while (xx > 0){
		if (x / xx % 10 == y / yy % 10){
			cout << x / xx % 10 << y / yy % 10;
		}
		else {
			cout << max (x / xx % 10, y / yy % 10);
		}
		yy /= 10;
		xx /= 10;
	}
	return 0;
}