

function Main(input) {
  input = input.split("\n");
  var L = parseInt(input[0].split(" ")[0]);
  var R = parseInt(input[0].split(" ")[1]);
  var min=2018;
  var min2=2018;
  for(var i=L;i<Math.min(R+1,L+2020);i++){
    if(i%2019<min2&&i%2019>=min){
      min2=i%2019;
    }else if(i%2019<min){
      min2=min;
      min=i%2019;
    }
  }
  var ans=min*min2;

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));