#include <bits/stdc++.h>
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string l, r;
  cin >> l >> r;
  long long res;
  long long n = r.size();
  long long ri = stoll(r);
  long long li = stoll(l);
  if (ri < (5 * pow(10, n - 1)) || li > (5 * pow(10, n - 1))) {
    if (ri < (5 * pow(10, n - 1))) {
      string ref;
      for (int i = 0; i < n; ++i) {
        ref += (9 - (r[i] - '0')) + '0';
      }
      long long refi = stoll(ref);
      res = (long long)(ri)*refi;
      cout << res;
    } else if (li > (5 * pow(10, n - 1))) {
      string ref;
      for (int i = 0; i < n; ++i) {
        ref += (9 - (l[i] - '0')) + '0';
      }
      long long refi = stoll(ref);
      res = (long long)(li)*refi;
      cout << res;
    }
  } else {
    string ref;
    ref += '4';
    for (int i = 0; i < n - 1; ++i) {
      ref += (9 + '0');
    }
    long long refi = stoll(ref);
    long long tmp = 5 * pow(10, n - 1);
    res = tmp * refi;
    cout << res;
  }
}
