#include <bits/stdc++.h>
using namespace std;
const unsigned long long int N = 100005;
unsigned long long int check(unsigned long long int x) {
  unsigned long long int rev = 0, m = x, p = 1;
  while (m) {
    unsigned long long int rem = 9 - (m % 10);
    rev = rev + rem * p;
    p *= 10;
    m /= 10;
  }
  return x * rev;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    unsigned long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0, l, r;
    cin >> l >> r, l--;
    ans = r;
    for (i = 1; i <= 1e10; i *= 10) {
      if (r / i > 0) cnt = i;
    }
    l = max(l, cnt);
    while (r - l > 1) {
      unsigned long long int mid = (l + r) >> 1;
      if (check(mid) > check(mid + 1)) {
        ans = mid;
        r = mid;
      } else
        l = mid;
    }
    cout << check(ans);
  }
  return 0;
}
