#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int x, y;
    int z[20];
    int c=0;
    cin >> x >> y;
    while (x!=0 || y!=0)
    {
        int cifrax =x%10;
        int cifray = y%10;
        if (cifrax == cifray && x!=0 && y !=0)
        {
            z[c++] = cifrax;
            z[c++] = cifrax;
        }
        else
            z[c++] = max(cifrax, cifray);
        x /= 10;
        y /= 10;
    }
    for (int i =c-1; i>=0; i--)
        cout << z[i];
    return 0;
}