#include <iostream>

using namespace std;

int main()
{
    int br1,br2,pom1,pom2,br=0,jed=1;
    cin>>br1>>br2;
    while(br1!=0 && br2!=0)
    {
        pom1=br1%10;
        pom2=br2%10;
        br1=br1/10;
        br2=br2/10;
        if(br1==0)
        {
            br=br+pom2*jed;
        }
        if(br2==0)
        {
            br=br+pom1*jed;
        }
        if(pom1>pom2)
        {
            br=br+(pom1*jed);
        }
        if(pom2>pom1)
        {
            br=br+(pom2*jed);
        }
        if(pom1==pom2)
        {
            br=br+(pom1*jed+pom2*(jed*10));
        }
        jed=jed*10;
    }
    cout<<br;
    return 0;
}