#include<iostream>
using namespace std;
 
int main(){
long long c,b,br1,br2,a[30];
long long cifra=0;
std::cin>>c;
std::cin>>b;
while(c>0 or b>0){
br1=c%10;
br2=b%10;
if(br2==br1 and c>0){
a[cifra]=br1;
cifra+=1;
a[cifra]=br2;
cifra+=1;
}
else if(br2<br1){
a[cifra]=br1;
cifra+=1;
}
else{
a[cifra]=br2;
cifra+=1;
}
b=b/10;
c=c/10;
}
for(long long v=cifra-1;v>=0;v--){
std::cout<<a[v];
}
return 0;
}