#include <bits/stdc++.h>
using namespace std;
const int MAX_SIZE = 10000;
long long Func(long long n) {
  long long tmp = n;
  long long cnt = 0;
  while (tmp / 10) {
    tmp /= 10;
    cnt++;
  }
  long long v = 1;
  for (int i = 0; i < cnt; i++) v *= 10;
  long long sum = 0;
  while (v >= 1) {
    long long d = n / v;
    long long rev = 9 - d;
    rev *= v;
    sum += rev;
    n %= v;
    v /= 10;
  }
  return sum;
}
int main() {
  long long l, r;
  cin >> l >> r;
  vector<long long> ls;
  vector<long long> rs;
  long long kurai = 1;
  while (1) {
    if (kurai > r) break;
    if (l < kurai * 10) {
      if (l >= kurai) {
        ls.push_back(l);
        if (r < kurai * 10) {
          rs.push_back(r);
        } else
          rs.push_back(kurai * 10 - 1);
      } else {
        ls.push_back(kurai);
        if (r < kurai * 10) {
          rs.push_back(r);
        } else
          rs.push_back(kurai * 10 - 1);
      }
    }
    kurai *= 10;
  }
  long long mediun = 1;
  int tnn = ls[0];
  while (tnn / 10) {
    tnn /= 10;
    mediun *= 10;
  }
  int qqq = mediun;
  mediun *= 10;
  mediun /= 2;
  long long mediun2 = mediun - 1;
  swap(mediun, mediun2);
  vector<long long> maxL;
  for (int i = 0; i < ls.size(); i++) {
    if ((ls[i] <= mediun && rs[i] >= mediun) &&
        (ls[i] <= mediun2 && rs[i] >= mediun2)) {
      maxL.push_back(max(mediun * Func(mediun), mediun2 * Func(mediun2)));
    } else if ((ls[i] <= mediun && rs[i] >= mediun)) {
      maxL.push_back(mediun * (Func(mediun)));
    } else if (ls[i] <= mediun2 && rs[i] >= mediun2) {
      maxL.push_back(mediun2 * (Func(mediun2)));
    } else {
      if (rs[i] < mediun) {
        maxL.push_back(rs[i] * (Func(rs[i])));
      } else if (ls[i] > mediun2) {
        maxL.push_back(ls[i] * (Func(ls[i])));
      }
    }
    qqq *= 10;
    mediun = qqq;
    mediun *= 10;
    mediun /= 2;
    mediun2 = mediun - 1;
    swap(mediun, mediun2);
  }
  long long maxN = 0;
  for (int i = 0; i < maxL.size(); i++) {
    maxN = max(maxN, maxL[i]);
  }
  cout << maxN << endl;
  return 0;
}
