#include <bits/stdc++.h>
using namespace std;
long long get(long long n) {
  long long ans = 0, mn = 1;
  while (n) {
    ans += mn * (9 - (n % 10));
    n /= 10;
    mn *= 10;
  }
  return ans;
}
long long cnt(long long n) {
  long long q = 0;
  while (n) {
    n /= 10;
    q++;
  }
  return q;
}
int main() {
  long long a, b, ans = -1;
  cin >> a >> b;
  long long x = a, y = get(a);
  if (x > y) {
    ans = x * y;
  } else {
    long long pl = ((x + y) / 2) - x;
    pl = min(pl, b - a) + a;
    ans = pl * get(pl);
  }
  x = b;
  y = get(b);
  if (x < y) {
    ans = x * y;
  } else {
    long long pl = ((x + y) / 2) - y;
    pl = min(pl, b - a) + y;
    ans = max(ans, pl * get(pl));
  }
  x = cnt(a) + 1;
  y = cnt(b) - 1;
  for (long long i = x; i <= y; i++) {
    long long a = 8;
    for (long long j = 2; j <= i; j++) a = 10 * a + 9;
    ans = max(ans, a * get(a));
  }
  cout << ans << endl;
  return 0;
}
