#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int a,b,lena,lenb,digat,digbt,longs,res,total = 0;
    int dec = 1;
    std::vector< int > diga;
    std::vector< int > digb;
    std::vector< int > anst;
    
    cin>>a>>b;
    
    lena = to_string(a).length();
    lenb = to_string(b).length();
    
    diga.push_back(lena);
    digb.push_back(lenb);
    digat = diga[0];
    digbt = digb[0];
    
    if(digat > digbt){
        longs = digat;
    }else if(digat < digbt){
        longs = digbt;
    }else{
        longs = digat;
    }

    int tempa = digat;
    int tempb = digbt;
    
    for(int y=0; y<longs; y++){
        diga[y]=a%10;
        a=a/10;
        digb[y]=b%10;
        b=b/10;
        tempa--;
        tempb--;
        
        if(tempa < 0){
            diga.clear();
        }else if(tempb < 0){
            digb.clear();
        }
        
        if(!diga.empty() && !digb.empty()){
            if(diga[y] > digb[y]){
                anst.push_back(diga[y]);
            }else if(diga[y] < digb[y]){
                anst.push_back(digb[y]);
            }else if(diga[y] == digb[y]){
                anst.push_back(diga[y]);
                anst.push_back(digb[y]);
            }   
        }else if(diga.empty() && !digb.empty()){
            anst.push_back(digb[y]);
        }else if(!diga.empty() && digb.empty()){
            anst.push_back(diga[y]);
        }
    }   
    
    for (auto& it : anst)
    {
        total += it * dec;
        dec *= 10;
    }
    
    cout << total;

    return 0;
}