#include <bits/stdc++.h>
using namespace std;
const int big = 1e9;
const int N = 1e5 + 228;
const int md = 1e9 + 7;
long long l, r, p10[10];
long long ans;
long long rev(long long x) {
  long long ans = 0, kol = 0;
  while (x > 0) {
    long long d = 9 - x % 10;
    kol++;
    ans += d * p10[kol - 1];
    x /= 10;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  p10[0] = 1;
  for (int i = 1; i <= 9; i++) p10[i] = p10[i - 1] * 10;
  cin >> l >> r;
  ans = max(1ll * l * rev(l), 1ll * r * rev(r));
  for (long long i = 0; i <= 9; i++) {
    long long d = 5 * p10[i] - 1ll;
    if (d < l || d > r) continue;
    ans = max(ans, 1ll * d * rev(d));
  }
  cout << ans << endl;
  return 0;
}
