#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
  ll x, y;
  cin >> x >> y;

  stack<int> res;

  while (x || y)
  {
    int x1 = x % 10;
    int y1 = y % 10;

    if (x1 == y1 && (x != 0) && (y != 0))
    {
      res.push(x1);
      res.push(x1);
    }
    else if (x1 > y1)
    {
      res.push(x1);
    }
    else
    {
      res.push(y1);
    }

    x /= 10;
    y /= 10;
  }

  while (!res.empty())
  {
    cout << res.top();
    res.pop();
  }
  cout << "\n";
}