#include <bits/stdc++.h>
void dbg(const char* fmt, ...) {}
long long phi(long long x) {
  long long ans = 0;
  long long cur = 1;
  while (x) {
    ans += (9 - x % 10) * cur;
    cur *= 10;
    x /= 10;
  }
  return ans;
}
int len(long long x) {
  int ans = 0;
  while (x) {
    ans++;
    x /= 10;
  }
  return ans;
}
long long pow(long long x, int p) {
  long long ans = 1;
  while (p--) ans *= x;
  return ans;
}
int main() {
  long long l, r;
  std::cin >> l >> r;
  long long m = 5 * pow(10, len(r) - 1);
  if (m >= l && m <= r) {
    std::cout << m * phi(m) << std::endl;
    return 0;
  }
  m--;
  if (m >= l && m <= r) {
    std::cout << m * phi(m) << std::endl;
    return 0;
  }
  std::cout << std::max(l * phi(l), r * phi(r)) << std::endl;
  return 0;
}
