#include <iostream>
#include <math.h>
using namespace std;

int main()
{int X,x,Y,y,n,N,z;
    cin>>X;
    cin>>Y;
    N=0;
    n=0;
    if (X/10>=Y/10)
    {while (X>0)
    {x=X%10;
     X=(X-x)/10;
    
     y=Y%10;
     Y=(Y-y)/10;
     
    if (y>=x)
    z=y;
    else
    z=x;
    N=N+z*pow(10,n);
    n++;
    }
    }
    else
    {while (Y>0)
    {x=X%10;
     X=(X-x)/10;
    
     y=Y%10;
     Y=(Y-y)/10;
     
    if (y>=x)
    z=y;
    else
    z=x;
    N=N+z*pow(10,n);
    n++;
    }
    }
    cout<<N;
    return 0;
}