#include <bits/stdc++.h>
using namespace std;
const long long inf = 1 << 60;
long long toLong(string s) {
  static const string up = "1000000001";
  if (s.size() > up.size()) return inf;
  if (s.size() == up.size() && s >= up) return inf;
  long long ans = 0;
  stringstream ss;
  ss << s;
  ss >> ans;
  return ans;
}
vector<string> A;
vector<string> B;
void gen(vector<string> &where, const int n) {
  where.clear();
  string s = "";
  for (int _n(11), i(0); i < _n; i++) {
    where.push_back(s);
    s += char('0' + n);
  }
}
long long inv(long long x) {
  long long m = 1;
  long long a = 0;
  while (x) {
    a += m * (9 - x % 10);
    m *= 10;
    x /= 10;
  }
  return a;
}
int main() {
  int left, right;
  cin >> left >> right;
  if (left > right) {
    cout << 0 << endl;
    return 0;
  }
  if (right < 10) {
    long long a = 0;
    for (int x = left; x <= right; ++x) a = max(a, x * inv(x));
    cout << a << endl;
    return 0;
  }
  gen(A, 4);
  gen(B, 9);
  long long ans = 0;
  for (int _n(A.size()), i(0); i < _n; i++)
    for (int _n(B.size()), j(0); j < _n; j++) {
      long long x = toLong(A[i] + B[j]);
      if (x == inf) continue;
      long long y = inv(x);
      if (x >= left && x <= right || y >= left && y <= right)
        ans = max(ans, x * y);
    }
  if (left * inv(left) > ans) ans = left * inv(left);
  if (right * inv(right) > ans) ans = right * inv(right);
  cout << ans << endl;
  return 0;
}
