#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	string a, b, sol;
	cin >> a >> b;
	
	reverse(a.begin(), a.end());
	reverse(b.begin(), b.end());
	
	vector<char> v;
	
	for(int i = 0; i < max(a.length(), b.length()); i++){
		sol.append(" ");
		if(i < a.length() && i < b.length()){
			if(a[i] == b[i]){
				v.push_back(a[i]);
				v.push_back(b[i]);
				sol.append(" ");
			}
			else if(a[i] > b[i])
				v.push_back(a[i]);
				
			else
				v.push_back(b[i]);
		}
		
		else if(i < a.length())
			v.push_back(a[i]);
			
		else
			v.push_back(b[i]);
			
	}

	for(int i = v.size(); i >= 0; i--)
		sol[v.size() - i - 1] = v[i];
	
	cout << sol;
	return 0;
}