#include <iostream>

using namespace std;

int count_digit(int number) {
   int count = 0;
   while(number != 0) {
      number = number / 10;
      count++;
   }
   return count;
}

int main()
{
    int n1, n2;
    cin >> n1 >> n2;
    int l1, l2;
    l1 = count_digit(n1);
    l2 = count_digit(n2);
    int x = 0;
    int y = 0;
    int k = 20;
    int cifre[k];
    int i = 0;
    int j = 0;
    int N1=n1;
    int N2=n2;
    for(int i = 0; i < min(l1, l2); i++)
    {
        if(i != 0)
        {
            N1=N1/10;
            N2=N2/10;
        }
        x = n1%10;
        n1 = n1/10;
        y = n2%10;
        n2 = n2/10;

        if(x == y)
        {
            cifre[j] = x;
            j++;
            cifre[j] = x;
        }
        else
        {
            cifre[j] = max(x, y);
        }
        j++;

    }
    if(l1 != l2)
    {
        cout << max(N1,N2)/10;
    }

    for(int p = 0; p < j; p++)
    {
        cout << cifre[j-1-p];
    }

    return 0;
}