#include<iostream>
using namespace std;

int main(){
std::ios_base::sync_with_stdio(false);
unsigned int x,y,rez,i=1;
cin>>x>>y;
while(x!=0||y!=0){
    if((x%10)==(y%10)&&y!=0&&x!=0){
        rez+=i*(y%10);
        i*=10;
        rez+=i*(x%10);
    }
    else if((x%10)>(y%10)){
        rez+=i*(x%10);
    }
    else{
        rez+=i*(y%10);
    }
    i*=10;
    x/=10;
    y/=10;
}
cout<<rez;
return 0;
}