#include <iostream>

using namespace std;

int main()
{
    long long x,y,NB=0,o=1;

    cin>>x>>y;
    while((x>0)&&(y>0)){
        if(x%10>=y%10) {
            NB=x%10*o+NB;
            o=o*10;}
        if(x%10<=y%10){

       NB=y%10*o+NB;
        o=o*10;}
        x=x/10;
        y=y/10;

    }
    if(x>0) NB=NB+x*o;
    if(y>0) NB=NB+y*o;
    cout<<NB;

}