#include <bits/stdc++.h>
using namespace std;
long long gao(long long n) {
  char ch[16];
  int num = 0;
  while (n) {
    ch[num++] = ('9' - n % 10);
    n /= 10;
  }
  long long ans = 0;
  for (int i = num - 1; i >= 0; i--) {
    ans = ans * 10 + ch[i] - '0';
  }
  return ans;
}
int main() {
  long long l, r;
  scanf("%I64d%I64d", &l, &r);
  long long num = 10;
  while (num <= r) {
    num *= 10;
  }
  num /= 10;
  long long ans1, ans2, ans3;
  ans1 = l * gao(l);
  ans2 = r * gao(r);
  ans3 = 5 * num * gao(5 * num);
  if (r < 5 * num || l > num * 5)
    cout << (ans1 > ans2 ? ans1 : ans2) << endl;
  else
    cout << ans3 << endl;
  return 0;
}
