#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e18 + 7;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
long long msum(long long a, long long b, long long m) {
  return (a % m + b % m) % m;
}
long long msub(long long a, long long b, long long m) {
  return (a % m - b % m) % m;
}
long long mpro(long long a, long long b, long long m) {
  return ((a % m) * (b % m)) % m;
}
long long m_m(long long a, long long b, long long m);
long long fxp(long long a, long long b, long long m);
void swap(long long &a, long long &b) {
  long long t = a;
  a = b;
  b = t;
}
vector<long long> convert(long long n) {
  vector<long long> v;
  while (n) {
    long long num = n % 10;
    v.push_back(num);
    n = n / 10;
  }
  reverse(v.begin(), v.end());
  vector<long long> temp;
  for (auto x : v) {
    temp.push_back(9 - x);
  }
  return temp;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    long long l, r;
    cin >> l >> r;
    long long digits = log10(r) + 1;
    l = max(l, (long long)(pow(10, digits) / 2));
    long long ans = min(l, r);
    long long val = 0;
    vector<long long> v = convert(ans);
    for (long long i = 0; i < v.size(); i++) {
      val = val * 10 + v[i];
    }
    long long res = ans * val;
    cout << res << "\n";
  }
  return 0;
}
long long fxp(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b % 2 == 0) return fxp(m_m(a, a, m), b / 2, m);
  return m_m(fxp(a, b - 1, m), a, m);
}
long long m_m(long long a, long long b, long long m) {
  long long res = 0;
  a = a % m;
  while (b) {
    if (b & 1) {
      res += a;
      res = res % m;
    }
    a = (a * 2) % m;
    b = b / 2;
  }
  return res;
}
