#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int X, Y, i, c = 0, br_cifa, br_cifb, veci, d = 0, ostatak;
    cin>>X;
    cin>>Y;
    br_cifa = int(log10(X) + 1);
    br_cifb = int(log10(Y) + 1);
    if(br_cifa > br_cifb)
        veci = br_cifa;
    else if(br_cifb>br_cifa)
        veci = br_cifb;
    else
        veci = br_cifa;

    for(i = 1; i <= veci; i++)
    {
        if(X % 10 > Y % 10)
        {
            c = c * 10 + X % 10;
            X = X / 10;
        	Y = Y / 10;
        }
        else if(Y % 10 > X % 10)
        {
            c = c * 10 + Y % 10;
            X = X / 10;
        	Y = Y / 10;
        }
        else if(X % 10 == Y % 10)
        {
            c = c * 10 + X % 10;
            c = c * 10 + Y % 10;
            X = X / 10;
        	Y = Y / 10;
        }
        if(X % 10 == 0)
        {
            c = c * 10 + Y % 10;
            Y = Y / 10;
        }
        else if(Y % 10 == 0)
        {
            c = c * 10 + X % 10;
            X = X / 10;
        }
    }
    while(c!=0)    
    {    
        ostatak = c % 10;      
        d = d * 10 + ostatak;    
        c /= 10;    
    }
    cout<<d;
}