#include <bits/stdc++.h>
using namespace std;
int l, r;
int w1, w2;
char s[30], t[30], s1[30];
int near(long long t) {
  if (l <= t && r >= t) return t;
  if (l <= t && r <= t) return r;
  if (r >= t && l >= t) return l;
}
long long go(int ss) {
  int ww = sprintf(t, "%d", ss);
  long long s1 = 0, s2 = 0;
  for (int i = 0; i < ww; i++) {
    int yy = t[i] - '0';
    s1 = s1 * 10 + yy;
    s2 = s2 * 10 + 9 - yy;
  }
  return s1 * s2;
}
int main() {
  int i, j, k;
  scanf("%d%d", &l, &r);
  w2 = sprintf(s, "%d", r);
  w1 = sprintf(t, "%d", l);
  long long s1 = 0;
  while (w2--) s1 = s1 * 10 + 9;
  int re = near((s1 + 1) / 2);
  int rt = near((s1 - 1) / 2);
  cout << max(go(re), go(rt)) << endl;
  return 0;
}
