// sudar brojeva.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
using namespace std;
#include <iostream>

int sudari(int x, int y)
{
    int i = 1;
    int j = i;
    int n = 0;
    while (x / i != 0 && y / i!=0)
    {
        if ((x/i) % 10 > (y/i) % 10)
        {
            n += j * ((x/i) % 10);
            //cout << n<< " x" << endl;
        }
        else if ((x/i) % 10 < (y/i) % 10)
        {
            n += j * ((y / i) % 10);
            //cout << n << " y" << endl;
        }
        else if ((x/i) % 10 == (y/i) % 10)
        {
            n += (j * ((y / i) % 10))+((j*10) * ((y / i) % 10));
            j *= 10;
           // cout << ((j *10) * ((y / i) % 10)) << endl;
        }
       /* cout << j << endl;
        cout <<  i << endl;
        cout <<  n << endl;*/


        i *= 10;
        j *= 10;
    }
    n += (x / i) * j + (y / i) * j;
    return n;
}

int main()
{
   
    int X;
    int Y;
    cin >> X;
    cin >> Y;
    
    
    cout << sudari(X, Y);



}