#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long l, r;
  cin >> l >> r;
  string s_l = to_string(l), s_r = to_string(r);
  long long m = s_l.length(), n = s_r.length();
  if (m == n) {
    long long num = 4, mx = 9;
    for (long long i = 1; i < n; i++) {
      num = num * 10 + 9;
      mx = mx * 10 + 9;
    }
    if (l > num + 1) {
      cout << 1ll * l * (mx - l) << endl;
    } else if (r < num) {
      cout << 1ll * r * (mx - r) << endl;
    } else {
      cout << 1ll * num * (mx - num) << endl;
    }
  } else {
    long long num = 4, mx = 9;
    for (long long i = 1; i < n; i++) {
      num = num * 10 + 9;
      mx = mx * 10 + 9;
    }
    long long final = min(num, r);
    cout << 1ll * final * (mx - final) << endl;
  }
  return 0;
}
