#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;
	}
	for(int i = 1 ; i <= countDigit(min); i++){
		if(max%10 > min%10){
			cout << max%10;
		}
		else if(max%10 == min%10){
			cout << min%10 << max%10;
		}
		else cout << min%10;
		max/=10;
		min/=10;
	}
	while(max>0){
		cout << max % 10;
		max /= 10;
	}
		
	return 0;
}