#include <bits/stdc++.h>
using namespace std;
long long peak[11];
int digits(long long val) {
  int result = 0;
  while (val) {
    result++;
    val /= 10;
  }
  return result;
}
bool isFirst(long long val) {
  while (val != 1) {
    if (val % 10 != 0) return false;
    val /= 10;
  }
  return true;
}
long long pow(long long val, long long p) {
  long long factor = val;
  long long result = 1;
  while (p) {
    if (p & 1) {
      result = result * factor;
    }
    factor = factor * factor;
    p >>= 1;
  }
  return result;
}
long long calProduct(long long val) {
  int d = digits(val);
  return val * (pow(10, d) - 1 - val);
}
int main() {
  long long factor = 1;
  for (int i = 1; i < sizeof(peak) / sizeof(peak[0]); ++i) {
    factor *= 10;
    peak[i] = (factor - 1) / 2;
  }
  long long leftB, rightB;
  while (cin >> leftB >> rightB) {
    long long ans = -1;
    for (int i = sizeof(peak) / sizeof(peak[0]) - 1; i >= 1; --i)
      if (peak[i] <= rightB && peak[i] >= leftB) {
        ans = calProduct(peak[i]);
        break;
      }
    ans = max(ans, calProduct(rightB));
    ans = max(ans, calProduct(leftB));
    cout << ans << endl;
  }
}
