#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <time.h>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <windows.h>

using namespace std;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::ifstream;
using std::istringstream;
using std::ostringstream;
using std::string;
using std::stringstream;
using std::vector;

vector<int> getDigits(int x)
{
    vector<int> digitsArray = {};
    while (x > 0)
    {
        int digit = x % 10;
        x /= 10;
        digitsArray.insert(digitsArray.begin(), digit);
    }

    return digitsArray;
}

int main(void)
{
    int x, y;
    vector<int> xArray, yArray, outputArray;

    cin >> x >> y;

    xArray = getDigits(x);
    yArray = getDigits(y);

    if (xArray.size() < yArray.size())
    {
        int temp = yArray.size() - xArray.size();
        for (int i = 0; i < temp; i++)
            xArray.insert(xArray.begin(), -1);
    }
    else if (xArray.size() > yArray.size())
    {
        int temp = xArray.size() - yArray.size();
        for (int i = 0; i < temp; i++)
            yArray.insert(yArray.begin(), -1);
    }

    for (int i = 0; i < max(xArray.size(), yArray.size()); i++)
    {
        outputArray.push_back(max(xArray[i], yArray[i]));
        if (xArray[i] == yArray[i])
            outputArray.push_back(max(xArray[i], yArray[i]));
    }
    for (int x : outputArray)
    {
        cout << x;
    }

    return 0;
}