#include <bits/stdc++.h>
using namespace std;
long long rev(long long x) {
  long long ans = 0;
  if (x == 0) ans = 9;
  int o = 1;
  while (x != 0) {
    ans = ans + (9 - (x % 10)) * o;
    o *= 10;
    x /= 10;
  }
  return ans;
};
int main() {
  long long l, r;
  cin >> l >> r;
  long long ans = l;
  ans *= rev(l);
  long long X = r;
  X *= rev(r);
  ans = max(ans, X);
  X = 4;
  while (r > X * 10 + 9) {
    X *= 10;
    X += 9;
  }
  if (X <= r && X >= l) ans = max(ans, X * rev(X));
  cout << ans << endl;
  return 0;
}
