function main(input) {
  const args = input.split("\n");
  const n = args.length;

  for (let i = 0; i < n; i++) {
    let m, f, r;
    [m, f, r] = args[i].split(" ").map((x) => Number(x));
    if (m === -1 && f === -1 && r === -1) {
      break;
    }
    if (m === -1 || f === -1) {
      console.log("F");
    } else if (m + f >= 80) {
      console.log("A");
    } else if (65 <= m + f && m + f < 80) {
      console.log("B");
    } else if (50 <= m + f && m + f < 65) {
      console.log("C");
    } else if (30 <= m + f && m + f < 50) {
      if (r >= 50) {
        console.log("C");
      } else {
        console.log("D");
      }
    } else {
      console.log("F");
    }
  }
}

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