#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b != 0 ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
long long Pow(long long n, long long e) {
  if (e == 0) return 1;
  if (e == 1)
    return n;
  else if (e & 1) {
    long long t = Pow(n, e / 2);
    return n * t * t;
  } else {
    long long t = Pow(n, e / 2);
    return t * t;
  }
}
long long minN = 0, maxN = 0;
string minS, maxS;
int nextD[5][2] = {{4, 5}, {3, 6}, {2, 7}, {1, 8}, {0, 9}};
long long Solve(int id, long long n1, long long n2) {
  if (id == (int)(maxS).size()) {
    if (n1 >= minN && n1 <= maxN) return n1 * n2;
    return -1;
  }
  long long res = -1;
  long long mult = Pow(10, (int)(minS).size() - id - 1);
  for (int i = 0, max_ = (5); i < max_; ++i) {
    long long next1 = 10 * n1 + nextD[i][0];
    long long next2 = 10 * n1 + nextD[i][1];
    long long r1 = Solve(id + 1, next1, 10 * n2 + nextD[i][1]);
    long long r2 = Solve(id + 1, next2, 10 * n2 + nextD[i][0]);
    if (r1 > -1 || r2 > -1) return max(r1, r2);
  }
  return res;
}
long long GetInv(long long n) {
  stringstream ss;
  ss << n;
  string s = ss.str();
  long long res = 0;
  for (int i = 0, max_ = ((int)(s).size()); i < max_; ++i)
    res = res * 10 + (9 - (s[i] - '0'));
  return res;
}
int main() {
  cin >> minS >> maxS;
  if ((int)(minS).size() < (int)(maxS).size()) {
    minS.clear();
    minS += '1';
    for (int i = 0, max_ = ((int)(maxS).size() - 1); i < max_; ++i) minS += '0';
  }
  for (int i = 0, max_ = ((int)(minS).size()); i < max_; ++i)
    minN = 10 * minN + minS[i] - '0';
  for (int i = 0, max_ = ((int)(maxS).size()); i < max_; ++i)
    maxN = 10 * maxN + maxS[i] - '0';
  long long res = 0;
  long long min = minN, max = maxN, curr1, curr2;
  while (min <= max) {
    curr1 = (2 * min + max) / 3;
    curr2 = (min + 2 * max) / 3;
    long long inv1 = GetInv(curr1);
    long long inv2 = GetInv(curr2);
    long long m1 = curr1 * inv1;
    long long m2 = curr2 * inv2;
    res = std::max(res, std::max(m1, m2));
    if (m1 <= m2) {
      min = curr1 + 1;
    } else {
      max = curr2 - 1;
    }
  }
  printf("%I64d\n", res);
  return 0;
}
