#include <bits/stdc++.h>
using namespace std;
long long d[] = {0,      9,       99,       999,       9999,      99999,
                 999999, 9999999, 99999999, 999999999, 9999999999};
int digi(int x) {
  int cnt = 0;
  while (x) {
    cnt++;
    x /= 10;
  }
  return cnt;
}
long long f(long long x, int conta) { return (d[conta] - x) * (long long)x; }
int main() {
  int x, y;
  cin >> x >> y;
  int c1 = digi(x);
  int c2 = digi(y);
  long long lo, hi;
  long long ans = INT_MIN;
  for (int i = c1; i <= c2; i++) {
    if (i == c1) {
      lo = x;
      hi = (i == c2 ? y : d[i]);
    } else {
      lo = d[i - 1] + 1;
      hi = (i == c2 ? y : d[i]);
    }
    while (hi - lo > 2) {
      long long m1 = (lo * 2 + hi * 1) / 3;
      long long m2 = (lo * 1 + hi * 2) / 3;
      if (f(m1, i) < f(m2, i))
        lo = m1;
      else
        hi = m2;
    }
    for (int j = lo; j <= hi; j++) {
      ans = max(ans, f(j, i));
    }
  }
  cout << ans << '\n';
}
