#include <bits/stdc++.h>
using namespace std;
const bool ready = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  return true;
}();
const double PI = acos(-1);
using ll = long long;
using pii = pair<ll, ll>;
using pdd = pair<double, double>;
using vd = vector<double>;
using vb = vector<bool>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;
ll reflect(vi& a) {
  ll i1 = 0;
  ll i2 = 0;
  for (ll k : a) {
    i1 *= 10;
    i1 += k;
    i2 *= 10;
    i2 += (9 - k);
  }
  return i1 * i2;
}
void solve() {
  ll l;
  cin >> l;
  ;
  ll r;
  cin >> r;
  ;
  vi vl;
  vi vr;
  while (l || r) {
    vl.push_back(l % 10);
    l /= 10;
    vr.push_back(r % 10);
    r /= 10;
  }
  reverse((vl).begin(), (vl).end());
  reverse((vr).begin(), (vr).end());
  ll ans = max(reflect(vl), reflect(vr));
  vi ten = {5};
  while (ten.size() <= vl.size() && vl <= ten && ten <= vr) {
    ans = max(ans, reflect(ten));
    ten.push_back(0);
  }
  cout << ans << endl;
}
signed main() { solve(); }
