#include <bits/stdc++.h>
using namespace std;
long long cal(long long n) {
  long long m = n;
  long long x = 1, res = 0;
  while (m) {
    long long tmp = m % 10;
    tmp = 9 - tmp;
    res += (x * tmp);
    m /= 10;
    x *= 10;
  }
  return n * res;
}
long long magic(long long n) {
  long long m = n;
  long long x = 1, res = 0;
  while (m > 9) {
    res += (x * 9);
    m /= 10;
    x *= 10;
  }
  res += (x * 4);
  return res;
}
int main() {
  long long l, r;
  cin >> l >> r;
  long long m = magic(r);
  cout << cal(min(max(l, m), r)) << endl;
  return 0;
}
