#include <iostream>
using namespace std;
int main()
{
    int x,y;
    int a,b;
    int i=1;
    cin>>x>>y;
    float n=0;
    int rez=0;
    
    while(x!=0 && y!=0){
    
   
    
    a=x%10;
    b=y%10;
    if(a>b)
    {n=a;}
    else if(a<b)
    {n=b;}
    else
    {
    if(a==0 && b==0)
    { i*=10;
        
    }else{
        float h=float(b);
    
        n=h/10+b;
       i*=10 ;
    }
    }
        
    rez+=n*i;
    x=x/10;
    y=y/10;
   i=i*10;
        
    }
    cout<<rez;
    return 0;
}