#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, r;
  cin >> l >> r;
  long long x = r, y = 0;
  while (x > 0) {
    ++y;
    x /= 10;
  }
  x = 5;
  long long k = y;
  for (int i = 0; i < k - 1; ++i) {
    x *= 10;
  }
  if (r < x)
    x = r;
  else if (l > x)
    x = l;
  k = x;
  vector<long long> ans;
  while (k > 0) {
    ans.push_back(k % 10);
    k /= 10;
  }
  reverse(ans.begin(), ans.end());
  y = 0;
  for (auto& i : ans) {
    y *= 10;
    y += 9 - i;
  }
  cout << x * y;
  return 0;
}
