let () = Scanf.scanf "%d %d" @@ fun l r ->
  Printf.printf "%d\n" @@
  if
    l = 0 ||
    1 <= r / 673 - (l - 1) / 673 &&
    1 <= r / 3 - (l - 1) / 3
  then 0
  else (l mod 2019) * ((l + 1) mod 2019)

