"use strict";
main(require("fs").readFileSync("/dev/stdin", "utf8").replace(/\r?\n$/, "").split(/\r?\n/));

function main(lines){
	lines.some(function(line){
		var ary = line.split(" ").map(Number);
		var a = ary[0], b = ary[1], c = ary[2];
		if(!(a+1||b+1||c+1)) return true;
		console.log(a==-1||b==-1?"F":a+b>=80?"A":a+b>=65?"B":a+b>=50?"C":a+b>=30?c>=50?"C":"D":"F");
	});
}