#include <bits/stdc++.h>
using namespace std;
string s[105];
int n, m;
int main() {
  long long l, r;
  cin >> l >> r;
  int digit1, digit2;
  digit1 = digit2 = 0;
  long long l1, r1;
  l1 = l;
  r1 = r;
  while (l1 != 0) {
    l1 /= 10;
    digit1++;
  }
  while (r1 != 0) {
    r1 /= 10;
    digit2++;
  }
  int digit = max(digit1, digit2);
  long long min_val = 1;
  long long max_val = 9;
  digit--;
  while (digit != 0) {
    min_val *= 10;
    digit--;
    max_val *= 10;
    max_val += 9;
  }
  if ((max_val + 1) / 2 >= l && (max_val + 1) / 2 <= r) {
    cout << (max_val - (max_val + 1) / 2) * (max_val + 1) / 2 << endl;
  } else if (r < (max_val + 1) / 2) {
    cout << (max_val - r) * r << endl;
  } else {
    if (l < min_val)
      cout << max((max_val - l) * l,
                  (max_val - (max_val + 1) / 2) * (max_val + 1) / 2)
           << endl;
    else
      cout << (max_val - l) * l << endl;
  }
  return 0;
}
