#include <iostream>

using namespace std;

int main(){
int x, y, c=0;
cin>>x>>y;
int m1, m2;

if(x<y){
m1=x;
m2=y;
}
if(x>y){
m1=y;
m2=x;}
int t=1;
while(m2!=0){
int b1=m2%10;
m2=m2/10;
if(m1!=0){
int b2=m1%10;
m1=m1/10;
if(b1<b2){
c=c+b2*t;}
else if(b1>b2){
c=c+b1*t;}
else{
c=c+(b1*t + b2*t*10);
t=t*10;}
}
else{
c=c+b1*t;}
t=10;}
cout << c << endl;
return 0;
}