#include <bits/stdc++.h>
using namespace std;
int main()
{
    int X, Y;
    cin >> X >> Y;
    vector<int> x, y;
    vector<int> z;
    int a = X, b = Y;

    while(X>0)
    {
        x.push_back(X%10);
        X/=10;
    }
    while(Y>0)
    {
        y.push_back(Y%10);
        Y/=10;
    }

    for(int j = 0; j<min(x.size(), y.size()); j++)
    {
        if(x[j] == y[j])
        {
            z.push_back(x[j]);
            z.push_back(y[j]);
        } else
        {
            z.push_back(max(x[j],y[j]));
        }
    }
    if(a>b)
    {
        for(int i =x.size()-1; i>=y.size(); i--) cout << x[i];
    } else
    {
        for(int i =y.size()-1; i>=x.size(); i--) cout << y[i];
    }


    for(int i =z.size()-1; i>=0; i--) cout << z[i];

}