#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int X,Y;
cin>>X;
cin>>Y;
int s=1;
int b=0;
if (X<Y){
int a=X;
X=Y;
Y=a;
}
while(X>0){
if(Y==0){
b=b+X%10*s;
}
if(X%10>Y%10 and Y!=0){
b=b+X%10*s;
}
if(X%10==Y%10 and Y!=0){
b=b+X%10*s;
s=s*10;
b=b+Y%10*s;
}
if(X%10<Y%10){
b=b+Y%10*s;
}
s=s*10;
X=X/10;
Y=Y/10;
}
cout<<b<<endl;
}