#include <bits/stdc++.h>
using namespace std;
long long f(long long x) {
  if (x < 10) return 9 - x;
  return f(x / 10) * 10 + (9 - (x % 10));
}
long long solve(long long x, long long y, long long z) {
  if (x > y) return 0;
  long long res = max(x * f(x), y * f(y));
  long long v = z / 2;
  if (x <= v && v <= y) res = max(res, v * f(v));
  return res;
}
int main() {
  long long a, b, best = 0;
  cin >> a >> b;
  for (long long first = 1; first <= b; first *= 10) {
    long long second = first * 10 - 1;
    best = max(best, solve(max(first, a), min(second, b), second));
  }
  cout << best << endl;
  return 0;
}
