#include <iostream>
#include <cmath>
#include <string>
using namespace std;

int NadjiBrCifara(unsigned int n) 
{
    int brCifara = 0;
    while (n > 0)
    {
        n /= 10;
        brCifara++;
    }
    return brCifara;
}

int main()
{
    unsigned int x, y;
    cin >> x;
    cin >> y;
    if (x < y)swap(x, y);
    int brCifaraX = NadjiBrCifara(x);
    int brCifaraY = NadjiBrCifara(y);
    string noviBr = "";
    while (brCifaraY != brCifaraX) 
    {
        brCifaraX--;
        noviBr += to_string(x / (unsigned int)pow(10, brCifaraX));
        x %= (unsigned int)pow(10, brCifaraX);
    }
    while (brCifaraY > 0) 
    {
        brCifaraY--;
        unsigned int cifraX = x / (unsigned int)pow(10, brCifaraY);
        unsigned int cifraY = y / (unsigned int)pow(10, brCifaraY);
        x %= (unsigned int)pow(10, brCifaraY);
        y %= (unsigned int)pow(10, brCifaraY);

        if (cifraX == cifraY) noviBr += to_string(cifraX) += to_string(cifraY);
        else if (cifraX > cifraY) noviBr += to_string(cifraX);
        else noviBr += to_string(cifraY);
    }
    cout << noviBr;
}