#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
int min(int a, int b) {
  if (a > b) {
    return b;
  } else {
    return a;
  }
}
long long change(long long a) {
  long long arr[100];
  long long i = 0;
  while (a > 0) {
    arr[i] = a % 10;
    i++;
    a /= 10;
  }
  for (int j = 0; j < i; j++) {
    arr[j] = 9 - arr[j];
  }
  long long res = 0;
  for (int j = i - 1; j >= 0; j--) {
    res *= 10;
    res += arr[j];
  }
  return res;
}
int main() {
  long long l, r;
  cin >> l >> r;
  long long i = 0;
  long long r1 = r;
  while (r1 > 0) {
    i++;
    r1 /= 10;
  }
  i--;
  long long ideal = (long long)pow(10, (double)i) * 5;
  if (r < ideal) {
    cout << (long long)r * change(r);
  } else if (l > ideal) {
    cout << (long long)l * change(l);
  } else {
    cout << (long long)ideal * change(ideal);
  }
}
