#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long int getPhi(long long int n) {
  long long int ans = 0;
  vector<long long int> a;
  while (n > 0) {
    a.push_back(n % 10);
    n /= 10;
  }
  reverse(a.begin(), a.end());
  for (auto i : a) ans = ans * 10 + (9 - i);
  return ans;
}
vector<long long int> borders = {
    0 / 2,      10 / 2,      100 / 2,      1000 / 2,      10000 / 2,
    100000 / 2, 1000000 / 2, 10000000 / 2, 100000000 / 2, 1000000000 / 2};
long long int getAns(long long int x) { return x * getPhi(x); }
signed main() {
  long long int l, r;
  cin >> l >> r;
  long long int ans = max(getAns(l), getAns(r));
  for (auto i : borders) {
    if (l <= i && i <= r) ans = max(ans, getAns(i));
  }
  cout << ans << "\n";
  return 0;
}
