#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
const double pi = acos(-1);
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
long long we(long long in) {
  int keta = log10(in) + 1;
  long long n = 0;
  while (keta--) n = n * 10 + 9;
  return in * (n - in);
}
int main() {
  long long l, r;
  cin >> l >> r;
  int keta = log10(r) + 1;
  long long n = 0;
  while (keta--) n = n * 10 + 9;
  long long ans = 0;
  for (long long i = l; i < min(r, l + 2); i++) ans = max(ans, we(i));
  for (long long i = r; i >= max(l, r - 2); i--) ans = max(ans, we(i));
  for (long long i = max(n / 2 - 1, l); i < min(n / 2 + 3, r); i++)
    ans = max(ans, we(i));
  if (n / 10) {
    n /= 10;
    for (long long i = max(n / 2 - 1, l); i < min(n / 2 + 3, r); i++)
      ans = max(ans, we(i));
  }
  cout << ans << endl;
}
