#include <bits/stdc++.h>
using namespace std;
long long reflection(long long num) {
  long long result = 0, i = 1;
  while (num) {
    result += (9 - num % 10) * i;
    num /= 10;
    i *= 10;
  }
  return result;
}
int main() {
  string fst, lst;
  cin >> fst >> lst;
  string buf = "4";
  for (int i = 0; i < lst.length() - 1; ++i) buf += '9';
  long long first = atoi(fst.c_str());
  long long last = atoi(lst.c_str());
  long long buffer = atoi(buf.c_str());
  if (first <= buffer && buffer <= last) {
    cout << buffer * reflection(buffer);
    return 0;
  }
  if (first >= buffer) {
    cout << first * reflection(first);
    return 0;
  }
  if (buffer >= last) {
    cout << last * reflection(last);
    return 0;
  }
  return 0;
}
