function Main(input) {
  input = input.split(" ");
  var a = parseInt(input[0]);
  var b = parseInt(input[1]);

  var num = b - a;
  var result = 0;
  var factorial = function (number) {
    for (var i = 1; i < number; i++) {
      result += i;
    }
    return result;
  }

  var tree = factorial(num);
  var x = tree - a;
  console.log(tree, x);
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));
