#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int N = 5e6 + 10;
long long mirror(long long n) {
  if (n == 0) return 9;
  long long ret = 0;
  long long t = 1;
  while (n) {
    ret += t * (9 - n % 10);
    t *= 10;
    n /= 10;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<long long> v;
  v.push_back(4);
  for (int i = 0; i < 10; i++) v.push_back(v.back() * 10 + 9);
  long long l, r;
  cin >> l >> r;
  long long ans = max(l * mirror(l), r * mirror(r));
  int i = upper_bound(v.begin(), v.end(), r) - v.begin() - 1;
  if (i >= 0 && v[i] >= l && v[i] <= r) ans = max(ans, v[i] * mirror(v[i]));
  cout << ans << '\n';
  return 0;
}
