#include <bits/stdc++.h>
const double PI = 3.1415926535898;
const double EPS = 1e-10;
using namespace std;
string a, b;
long long best;
long long A, B;
int main() {
  best = 0;
  a = b = "";
  long long ain, bin;
  cin >> ain >> bin;
  while (ain > 0) {
    char c = ain % 10;
    ain /= 10;
    string s;
    s += ('0' + c);
    a = s + a;
  }
  while (bin > 0) {
    char c = bin % 10;
    bin /= 10;
    string s;
    s += ('0' + c);
    b = s + b;
  }
  while (a.size() < b.size()) a = "0" + a;
  if (a[0] == '0') {
    a[0] = '1';
    for (int i = int(1); i < int(a.size()); i++) a[i] = '0';
  }
  A = 0;
  B = 0;
  for (int t = int(0); t < int(a.size()); t++) A *= 10, A += a[t] - '0';
  for (int t = int(0); t < int(b.size()); t++) B *= 10, B += b[t] - '0';
  long long target1 = 4;
  for (int t = int(1); t < int(b.size()); t++) target1 *= 10, target1 += 9;
  long long target2 = 5;
  for (int t = int(1); t < int(b.size()); t++) target2 *= 10, target2 += 0;
  if (target1 < A) target1 = A;
  if (target1 > B) target1 = B;
  if (target2 < A) target2 = A;
  if (target2 > B) target2 = B;
  vector<int> V1, V2;
  long long base = 1;
  for (int i = int(0); i < int(a.size()); i++)
    V1.push_back((target1 / base) % 10), V2.push_back((target2 / base) % 10),
        base *= 10;
  long long ct1 = 0, ct2 = 0;
  reverse(V1.begin(), V1.end());
  reverse(V2.begin(), V2.end());
  for (int i = int(0); i < int(V1.size()); i++) ct1 *= 10, ct1 += 9 - V1[i];
  for (int i = int(0); i < int(V2.size()); i++) ct2 *= 10, ct2 += 9 - V2[i];
  cout << max(ct1 * target1, ct2 * target2) << endl;
  return 0;
}
