#include <bits/stdc++.h>
using namespace std;
string s1, s2;
long double x, y;
long double init(const string &s) {
  long double p = 0;
  for (int i = 0; i < s.size(); i++) {
    p = p * 10 + s[i] - '0';
  }
  return p;
}
inline string midle(const string &S) {
  string s;
  s.resize(1, '4');
  s.resize(S.size(), '9');
  return s;
}
inline long double af(const string &S) {
  string s;
  s.resize(S.size());
  for (int i = 0; i < s.size(); i++) s[i] = '9' - S[i] + '0';
  return init(s);
}
int main() {
  cin >> s1 >> s2;
  x = init(s1);
  y = init(s2);
  cout << fixed << setprecision(0);
  long double p = init(midle(s2));
  if (y >= p)
    if (x <= p) {
      cout << p * (af(midle(s2))) << endl;
    } else {
      cout << x * af(s1) << endl;
    }
  else {
    cout << y * af(s2) << endl;
  }
  return 0;
}
