#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll A,B,R;
stack<int>S;
int main(){
	cin>>A>>B;
	while(A and B){
		if(A%10==B%10)
			S.push(A%10);
		S.push(max(A%10,B%10));
		A/=10;
		B/=10;
	}
	while(S.size()){
		cout<<S.top();
		S.pop();
	}
	cout<<endl;
	return 0;
}