#include <bits/stdc++.h>
using namespace std;
void init() {}
string tostr(long long num) {
  stringstream ss;
  ss << num;
  return ss.str();
}
long long tonum(const string& str) {
  long long num;
  stringstream ss(str);
  ss >> num;
  return num;
}
long long ref(long long c) {
  string str = tostr(c);
  for (int i = 0; i < str.size(); ++i) {
    str[i] = ('9' - str[i]) + '0';
  }
  return tonum(str);
}
int main() {
  init();
  long long l, r;
  cin >> l >> r;
  long long md = 5;
  long long res = -1;
  for (int i = 0; i < 10; ++i) {
    if (md >= l && md <= r) {
      res = max(res, md * (md - 1));
    }
    md *= 10;
  }
  res = max(res, l * ref(l));
  res = max(res, r * ref(r));
  cout << res << endl;
  return 0;
}
