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

int main(){
	int x,y;
	int rez = 0;
	int tmp = 10;
	cin >> x >> y;
	
	while(x > 0 or y > 0){
		if(x%10 == y % 10 and x != 0 and y != 0){
			rez = rez + tmp * (x%10);
			tmp *= 10;
			rez = rez + tmp * (y % 10);
			tmp *= 10;
		}
		
		else{
			rez = rez + tmp * max(x %  10, y % 10);
			tmp *= 10;
		}
		x /= 10; y /= 10;
	}
	cout << rez / 10 << endl;
}