#include <bits/stdc++.h>
using namespace std;
int getLength(long long x) {
  int res = 0;
  while (x) {
    x /= 10, res++;
  }
  return res;
}
long long process(long long x) {
  long long tmp = x;
  vector<long long> arr;
  while (tmp) {
    arr.push_back(tmp % 10);
    tmp /= 10;
  }
  int i;
  long long v = 0;
  for (i = ((int)arr.size()) - 1; i >= 0; i--) {
    v = v * 10 + (9 - arr[i]);
  }
  return x * v;
}
int main() {
  long long l, r;
  int i;
  cin >> l >> r;
  int N = getLength(r);
  vector<long long> mul = vector<long long>(N, 0);
  mul[0] = 1;
  for (i = 1; i < N; i++) mul[i] = mul[i - 1] * 10;
  long long opt1 = mul[N - 1] * 5;
  long long opt2 = opt1 - 1;
  for (i = N - 1; i >= 0; i--) {
    while (opt1 + mul[i] - 1 < l) {
      opt1 += mul[i];
    }
  }
  for (i = N - 1; i >= 0; i--) {
    while (opt2 - mul[i] + 1 > r) {
      opt2 -= mul[i];
    }
  }
  if (opt1 > r)
    cout << process(opt2) << endl;
  else if (opt2 < l)
    cout << process(opt1) << endl;
  else
    cout << max(process(opt1), process(opt2)) << endl;
  return 0;
}
