#include <math.h>
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    long int x, y, novi = 0, brojac = 1;
    cin >> x;
    cin >> y;
    long int veci, manji;
    
    if( x > y ){
        veci = x;
        manji = y;
    }
    else {
        veci = y;
        manji = x;
    }
    //cout << manji << " " << veci << endl;
    //cout << manji % 10  << " " << veci % 10 << endl;
    if(manji % 10 > veci % 10) novi = manji % 10;
    else if(manji % 10 == veci % 10) novi = manji % 10 + (veci % 10) * 10;
    else novi = veci % 10;
    veci = (veci - veci % 10) / 10;
    manji = (manji - veci % 10) / 10;
    
    //cout << manji << " " << veci << endl;
    //cout  << novi << endl;
    
    
    while (manji > 0){
        if(manji % 10 > veci % 10) novi = novi + (pow(10,brojac)) * ( manji % 10 );
        else novi = novi + (pow(10,brojac)) * ( veci % 10 );
        veci = (veci - veci % 10) / 10;
        manji = (manji - veci % 10) / 10;
        brojac ++;
    }
    //cout << manji << " " << veci << endl;
    //cout << novi << endl;
    //cout << brojac << endl;
    while (veci > 0){
        novi = novi + (pow(10,brojac)) * ( veci % 10 );
        veci = (veci - veci % 10) / 10;
        brojac ++;
    }

    
    cout << novi;
    

    return 0;
}