#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL;
int a, b;
void Load() { cin >> a >> b; }
long long f(long long y) {
  int z = y;
  vector<int> dg;
  while (z > 0) {
    dg.push_back(z % 10);
    z /= 10;
  }
  long long x = 0;
  for (int i = (int)dg.size() - 1; i >= 0; i--) x = x * 10 + 9 - dg[i];
  return y * x;
}
void Solve() {
  long long mx = 0;
  if (b < 5) {
    for (int i = a; i <= b; i++) {
      mx = max(mx, f(i));
    }
    cout << mx;
    return;
  }
  long long x = 5;
  long long t = 1;
  for (int i = 1; x * 10 <= b; i++) {
    x *= 10;
    t *= 10;
  }
  if (t * 10 <= b) {
    cout << f(b);
    return;
  }
  if (a >= x)
    cout << f(a);
  else
    cout << f(x);
}
int main() {
  Load();
  Solve();
  return 0;
}
