#include <bits/stdc++.h>
using namespace std;
long long int bas(long long int a) {
  long long int i = 0;
  while (a) {
    a /= 10;
    i++;
  }
  return i;
}
long long int ref(long long int c) {
  long long int us = 1, i = 0;
  while (c) {
    i += (9 - c % 10) * us;
    c /= 10;
    us *= 10;
  }
  return i;
}
long long int a, b, i, t;
long long int dizi[] = {1,         10,         100,         1000,
                        10000,     100000,     1000000,     10000000,
                        100000000, 1000000000, 10000000000, 100000000000};
int main() {
  cin >> a >> b;
  if (bas(a) == bas(b)) {
    i = bas(b);
    if (b < dizi[i] / 2)
      cout << ref(b) * b;
    else if (a <= dizi[i] / 2 and b >= dizi[i] / 2)
      cout << dizi[i] / 2 * (dizi[i] / 2 - 1);
    else if (a >= dizi[i] / 2)
      cout << ref(a) * a;
  } else {
    i = bas(b);
    if (b < dizi[i] / 2)
      cout << ref(b) * b;
    else
      cout << dizi[i] / 2 * (dizi[i] / 2 - 1);
  }
  return 0;
}
