#include <bits/stdc++.h>
using namespace std;
int s[10], e[10];
int main() {
  int str, end;
  while (cin >> str >> end) {
    int sz = 0;
    while (str != 0 || end != 0) {
      s[sz] = str % 10;
      str /= 10;
      e[sz] = end % 10;
      end /= 10;
      sz++;
    }
    long long res = 0, rev = 0;
    long long tl = 0, tr = 0;
    for (int i = sz - 1; i >= 0; i--) {
      tl = tl * 10 + s[i];
      tr = tr * 10 + e[i];
      long long mx = -1, b = -1, br = -1;
      for (int j = 0; j <= 9; j++) {
        long long t = res * 10 + j;
        long long trev = rev * 10 + 9 - j;
        if (t < tl || t > tr) continue;
        if (mx == -1 || mx < t * trev) {
          b = t;
          br = trev;
          mx = t * trev;
        }
      }
      res = b;
      rev = br;
    }
    cout << res * rev << endl;
  }
  return 0;
}
