#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long x, y;
    stack<int> output_stack;
    cin >> x >> y;
    if (y > x)
    {
        int t = x;
        x = y;
        y = x;
    }
    while (y > 0)
    {
        if (x % 10 > y % 10)
            output_stack.push(x % 10);
        else if (y % 10 > x % 10)
            output_stack.push(y % 10);
        else
        {
            output_stack.push(x % 10);
            output_stack.push(x % 10);
        }
        x = x / 10;
        y = y / 10;
    }
    while (x > 0)
    {
        output_stack.push(x % 10);
        x = x / 10;
    }
    while (!output_stack.empty())
    {
        std::cout << output_stack.top();
        output_stack.pop();
    }

    return 0;
}