#include <bits/stdc++.h>
using namespace std;
long long a, b;
char l[50], r[50];
int len;
void change(char *l, long long x) {
  int k = 0;
  while (x) {
    l[k++] = x % 10;
    x /= 10;
  }
  if (k > len) len = k;
}
int ans[50];
int main() {
  {
    cin >> a >> b;
    memset(l, 0, sizeof(l));
    memset(r, 0, sizeof(r));
    change(l, a);
    change(r, b);
    len--;
    long long anss = 0;
    for (int i = 1; i <= 9; i++)
      if (i >= l[len] && i <= r[len]) {
        bool flag;
        bool u = 0, d = 0;
        if (i < 5)
          flag = 0;
        else
          flag = 1;
        ans[len] = i;
        if (i < r[len]) u = 1;
        if (i > l[len]) d = 1;
        for (int j = len - 1; j >= 0; j--) {
          if (flag) {
            if (d)
              ans[j] = 0;
            else
              ans[j] = l[j];
          } else {
            if (u)
              ans[j] = 9;
            else
              ans[j] = r[j];
          }
        }
        long long nowansa = 0, nowansb = 0;
        for (int j = len; j >= 0; j--) {
          nowansa = nowansa * 10 + ans[j];
          nowansb = nowansb * 10 + 9 - ans[j];
        }
        if (nowansa * nowansb > anss) anss = nowansa * nowansb;
      }
    cout << anss << endl;
  }
  return 0;
}
