#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 1000;
const long long INF64 = (long long)1e18 + 1000;
const int N = (int)1e6 + 1000;
const int MOD = (int)1e9 + 7;
long long mirror(int x) {
  long long newx = 0;
  vector<int> d;
  while (x) {
    d.push_back(9 - x % 10);
    x /= 10;
  }
  reverse(d.begin(), d.end());
  for (auto i : d) {
    newx = newx * 10 + i;
  }
  return newx;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int l, r;
  cin >> l >> r;
  int hi = 0;
  long long ans = max(r * 1ll * mirror(r), l * 1ll * mirror(l));
  int memr = r;
  while (memr) {
    hi++;
    memr /= 10;
  }
  long long cur = 4;
  for (int i = 0; i < hi - 1; ++i) {
    cur = cur * 10 + 9;
  }
  if (cur >= l && cur <= r) {
    ans = max(ans, cur * 1ll * mirror(cur));
  }
  ++cur;
  if (cur >= l && cur <= r) {
    ans = max(ans, cur * 1ll * mirror(cur));
  }
  cout << ans;
}
