#include <bits/stdc++.h>
using namespace std;
 
int countDigit(long long n)
{
    if (n == 0)
        return 1;
    int count = 0;
    while (n != 0) {
        n = n / 10;
        ++count;
    }
    return count;
}

int main() {
	int a;
	int b;
	cin >> a >> b;
	int min = a;
	int max = b;
	if(b < a){
		min = b;
		max = a;
	}
	int r = 0;
	int j = 1;
	for(int i = 1; i <= countDigit(min); i++){
		if(max%10 > min%10){
			r += j*(max%10);
			j*=10;
		}
		else if(max%10 == min%10){
			 r+= j*(min%10);
			 j*=10; 
			 r+= j*(max%10);
			 j*=10;
		}
		else {
		r+=j*(min%10);
		j*=10;
	}
		max/=10;
		min/=10;
	}
	while(max>0){
		r+= j*(max%10);
		max /= 10;
	}
	cout << r;	
	return 0;
}