#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int n1,r1,n2,r2,d=1,br=0;
    cin>>n1>>n2;


    while(n1!=0 && n2!=0)
    {
               r1=n1%10;
               n1=n1/10;
               r2=n2%10;
               n2=n2/10;
               if(r1>r2){
                br+=r1*d;
               }else if(r2>r1){
                br+=r2*d;
               }else{
                br+=(r1*d)+r2*(d*10);
               }d=d*10;



    }cout<<br;
    cout<<endl;
return 0;
}