#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
long long ans = 0;
string a, b;
vector<char> v;
void solve(int i, bool f_low, bool f_up) {
  if (i == b.size()) {
    long long A = 0, B = 0;
    for (int j = 0; j < v.size(); j++) {
      A = A * 10 + v[j] - '0';
      B = B * 10 + 9 - v[j] + '0';
    }
    ans = max(ans, A * B);
    return;
  }
  int up;
  up = b[i] - '0';
  int low;
  if (i < a.size()) low = a[i] - '0';
  if (f_low) low = 0;
  if (f_up) up = 9;
  int digit = up;
  v.push_back(digit + '0');
  solve(i + 1, f_low | (digit != low), f_up | (digit != up));
  v.pop_back();
  digit = low;
  v.push_back(digit + '0');
  solve(i + 1, f_low | (digit != low), f_up | (digit != up));
  v.pop_back();
  digit = max(low, min(up, 5));
  v.push_back(digit + '0');
  solve(i + 1, f_low | (digit != low), f_up | (digit != up));
  v.pop_back();
  digit = max(low, min(up, 4));
  v.push_back(digit + '0');
  solve(i + 1, f_low | (digit != low), f_up | (digit != up));
  v.pop_back();
}
int main() {
  cin >> a >> b;
  solve(0, a.size() != b.size(), 0);
  cout << ans;
  return 0;
}
