#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1000;
long long f(long long n) {
  long long res1 = n;
  vector<int> ans;
  while (n > 0) {
    ans.push_back(n % 10);
    n /= 10;
  }
  long long res2 = 0, deg = 1;
  for (int i = 0; i < int(int((ans).size())); i++)
    res2 += (9 - ans[i]) * deg, deg *= 10;
  return res1 * res2;
}
int main() {
  long long lf, rg;
  cin >> lf >> rg;
  long long ans = 0;
  for (long long deg = 1; deg <= INF; deg *= 10) {
    long long lfa = max(deg, lf);
    long long rga = min(deg * 10 - 1, rg);
    if (lfa > rga) continue;
    while (rga - lfa > 100) {
      long long lfmid = lfa + (rga - lfa) / 3;
      long long rgmid = rga - (rga - lfa) / 3;
      if (f(lfmid) > f(rgmid))
        rga = rgmid;
      else
        lfa = lfmid;
    }
    for (long long i = lfa; i <= rga; i++) ans = max(ans, f(i));
  }
  cout << ans << endl;
  return 0;
}
