#include <bits/stdc++.h>
using namespace std;
void read(vector<int> &a) {
  for (auto &x : a) cin >> x;
}
void read(vector<long long> &a) {
  for (auto &x : a) cin >> x;
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  ~debug() { cerr << "\n"; }
  template <class c>
  typename enable_if<sizeof dud<c>(0) != 1, debug &>::type operator<<(c i) {
    cerr << boolalpha << i;
    return *this;
  }
  template <class c>
  typename enable_if<sizeof dud<c>(0) == 1, debug &>::type operator<<(c i) {
    return *this << range(begin(i), end(i));
  }
  template <class c, class b>
  debug &operator<<(pair<b, c> d) {
    return *this << "(" << d.first << ", " << d.second << ")";
  }
  template <class c>
  debug &operator<<(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it;
    return *this << "]";
  }
};
const int MOD = 1e9 + 7;
const int INF = (int)2e9 + 7;
const long long LINF = (long long)1e18;
const long double PI = 3.1415926535897932384626433832795;
long long func(int n) {
  string s = to_string(n);
  long long a = 0;
  for (int i = 0; i < s.size(); i++) {
    a *= 10;
    a += (9 - s[i] + 48);
  }
  return a;
}
void solve() {
  int l, r;
  cin >> l >> r;
  string s1 = to_string(l), s2 = to_string(r);
  if (s1.size() != s2.size()) {
    long long x = 1;
    for (int i = 0; i < (int)s2.size() - 1; i++) {
      x *= 10;
    }
    l = x;
  }
  while (r > l) {
    long long m1 = l + (r - l) / 3;
    long long m2 = r - (r - l) / 3;
    debug() << " ["
            << "m1"
               ": "
            << (m1) << "] "
            << " ["
            << "m2"
               ": "
            << (m2) << "] ";
    debug() << " ["
            << "l"
               ": "
            << (l) << "] "
            << " ["
            << "r"
               ": "
            << (r) << "] ";
    long long f1 = m1 * func(m1);
    long long f2 = m2 * func(m2);
    if (f1 < f2)
      l = m1 + 1;
    else
      r = m2 - 1;
  }
  cout << l * func(l);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int tt = 1; tt <= t; tt++) {
    solve();
  }
}
