#include <bits/stdc++.h>
int getlen(long long x) {
  int i = 0;
  while (x) {
    x /= 10;
    i++;
  }
  return i;
}
long long max(long long a, long long b) { return a > b ? a : b; }
long long getL(int l) {
  int i;
  long long x = 1;
  for (i = 0; i < l; i++) x *= 10;
  return x / 2;
}
int main() {
  long long l, r;
  scanf("%I64d %I64d", &l, &r);
  int len1 = getlen(l), len2 = getlen(r);
  long long tmp = getL(len2);
  if (len1 == len2) {
    if ((r >= tmp && l <= tmp) || (r >= tmp - 1 && l <= tmp - 1)) {
      printf("%I64d\n", (tmp - 1) * tmp);
    } else {
      printf("%I64d\n", max((tmp * 2 - 1 - l) * l, (tmp * 2 - 1 - r) * r));
    }
  } else {
    if (r >= tmp) {
      printf("%I64d\n", tmp * (tmp - 1));
    } else {
      printf("%I64d\n", (tmp * 2 - 1 - r) * r);
    }
  }
  return 0;
}
