#include <iostream>
#include <string.h>
#include <math.h>
#include <algorithm>

using namespace std;


int main() {
	string x, y, z; bool end=false;
		
	cin>>x>>y;
	
	z=(x.length()>y.length())?x:y;
	int k=0;
	
	int i=x.length()-1; int j=y.length()-1;
	
	
	if(x.length()>y.length()){
		while(i!=-1) {
			if(j!=-1){
				if(x[i]>y[j])
					z[k]=x[i];
				else if(x[i]<y[j])
					z[k]=y[j];
				else{
					z[k++]=y[j]; z.resize(z.length()+1);
					z[k]=y[j];
				}
				j--;
			}
			else
				z[k]=x[i];
			
			k++; i--;
		}
		
	}
	else {
		while(j!=-1){
			if(i!=-1){
				if(x[i]>y[j])
					z[k] = x[i];
				else if(x[i]<y[j])
					z[k]= y[j];
				else{
					z[k++]=y[j]; z.resize(z.length()+1);
					z[k]=y[j];
				}
				i--;
			}
			else
				z[k]=y[j];
			
			k++; j--;
			
		}
		
	}
	
	
	reverse(z.begin(), z.end());
	
	cout<<z;

}