#include <stdio.h>

long long brojcif(long long da){
	
	long long p = 0;
	
	while(da/1 != 0){
		p++;
		da /=10;
		
	}
	p++;
	return p-1;
}

int main(){
	
	
	
	long long da, ne, i, n, p = 0, nn1, nn2;
	
	scanf("%lld %lld", &da, &ne);
	
	long long n1[da], n2[ne];
	
	nn1 = brojcif(da);
	
	for(i = 0; i<nn1; i++){
		
		n1[i] = da%10;
		da=da/10;
	}
		
	nn2 = brojcif(ne);	
		
	for(i = 0; i<nn2; i++){
		
		n2[i] = ne%10;
		
		ne = ne/10;
		
		
		
	}
	
	if(nn1 > nn2) n = nn1;
		else n = nn2;
	if(nn1 == nn2) n = nn2;
		
	int n3[n];
	

	for(i = n-1; i>=0; i--){
		
		
		
		if(nn1>nn2){
			n3[p] = n1[i];
			p++;
			nn1--;
			continue;
		}
		
		if(nn1<nn2){
			n3[p] = n2[i];
			p++;
			nn2--;
			continue;
			
		}
		
		if(n1[i]>n2[i]){
			n3[p] = n1[i];
			p++;
	
			continue;
		}
		else if(n1[i]<n2[i]){
			n3[p] = n2[i];
			p++;
	
			
			continue;
		}
		
		if(n1[i] == n2[i]){
			n3[p] = n1[i];
			n3[p+1] = n1[i];
			p = p+2;
			
			continue;
		}
		
	}
	
	
	for(i = 0; i<p; i++){
		
		printf("%lld", n3[i]);
		
	}
	
	return 0;
}