#include <bits/stdc++.h>
const long long oo = 2 * 1000 * 1000 * 1000;
const int _cnt = 1000 * 1000;
const int _p = 1000 * 1000 * 1000 + 7;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return (b) ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
using namespace std;
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
long long l, r, p = 5;
int bat(long long k) {
  int num = 0;
  while (k) {
    num++;
    k /= 10;
  }
  return num;
}
long long pat(long long k) {
  int q = bat(k);
  long long t = 1;
  for (int i = 1; i <= q; i++) t *= 10;
  return t - 1 - k;
}
int main() {
  scanf("%I64d%I64d", &l, &r);
  int n = bat(r);
  for (int i = 1; i <= n - 1; i++) p *= 10;
  if (p >= l && p <= r) {
    printf("%I64d\n", p * (p - 1));
    return 0;
  }
  if (p > r) {
    printf("%I64d\n", r * pat(r));
    return 0;
  }
  if (p < l) {
    printf("%I64d\n", l * pat(l));
    return 0;
  }
  return 0;
}
