#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int l, r;
  cin >> l >> r;
  long long int a = l, b = r;
  long long int mmx = 0, c1 = 0, c2 = 0;
  while (b > 0) b /= 10, mmx = mmx * 10 + 9, c1++;
  while (a > 0) a /= 10, c2++;
  long long int mx = mmx / 2;
  if (c1 > c2) {
    if (mx >= r)
      cout << r * (mmx - r);
    else
      cout << mx * (mmx - mx);
  } else {
    if (mx >= r)
      cout << r * (mmx - r);
    else if (mx <= l)
      cout << l * (mmx - l);
    else
      cout << mx * (mmx - mx);
  }
}
