#include <iostream>
using namespace std;


int count_digits(int x,int y)
{
    string xs = to_string(x);
    string ys = to_string(y);
    if (xs.size()>ys.size())
        return xs.size();
    else
        return ys.size();
}
int main(void)
{
    int x,y,n=0,z=1;
    cin>>x>>y;
    int bx=count_digits(x,y);

    for(int i=0; i<bx;++i){

        if(x%10>y%10){
            n=n+z*(x%10);
            z=z*10;
            x=x/10;
            y=y/10;
        }
        else if(x%10==y%10 && x!=0 && y!=0){

                n=n+z*(x%10);
                z=z*10;
                n=n+z*(y%10);
                z=z*10;
                x=x/10;
                y=y/10;

        }

        else{
            n=n+z*(y%10);
            z=z*10;
            x=x/10;
            y=y/10;
        }
    }
    cout<<n;


    return 0;
}