#include <bits/stdc++.h>
using namespace std;
long long l, r;
int bitsize(long long a) {
  int size = 0;
  while (a > 0) {
    a /= 10;
    size++;
  }
  return size;
}
long long reflection(long long a) {
  long long res = 0;
  long long x = 1;
  while (a > 0) {
    int remian = a % 10;
    res += (9 - remian) * x;
    x *= 10;
    a /= 10;
  }
  return res;
}
int main() {
  cin >> l >> r;
  int l_size = bitsize(l);
  int r_size = bitsize(r);
  long long mid = 5;
  for (int i = 0; i < r_size - 1; i++) {
    mid *= 10;
  }
  if (mid < l)
    cout << l * reflection(l) << endl;
  else if (l < mid && r > mid)
    cout << mid * reflection(mid) << endl;
  else
    cout << r * reflection(r) << endl;
  return 0;
}
