#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int inf = 1000000001;
const double pi = 3.1415926535897932384626433832795;
int i, j, k, m, n, L, R;
int l[100], r[100], rn, ln;
long long ans;
void go(int at, int lf, int rf, long long x, long long y) {
  if (at == -1) {
    ans = max(ans, x * y);
    return;
  }
  if (!lf && !rf) {
    if (x > y) swap(x, y);
    go(at - 1, 0, 0, x * 10 + 9, y * 10);
    return;
  }
  for (int i = 0; i < 10; i++) {
    if (!lf || i >= l[at])
      if (!rf || i <= r[at])
        go(at - 1, lf & (i == l[at]), rf & (i == r[at]), x * 10 + i,
           y * 10 + 9 - i);
  }
}
int main() {
  cin >> L >> R;
  while (L > 0) {
    l[ln++] = L % 10;
    L /= 10;
  }
  while (R > 0) {
    r[rn++] = R % 10;
    R /= 10;
  }
  if (ln < rn) {
    ln = rn;
    for (i = 0; i < ln; i++)
      if (i + 1 == ln)
        l[i] = 1;
      else
        l[i] = 0;
  }
  n = ln;
  go(n - 1, 1, 1, 0, 0);
  cout << ans << endl;
  return 0;
}
