function Main(input) {
let info = input.split('\n');
let container = [];
for (let i = 0; i < info.length; i++){
container[i] = info[i].split(' ');
}
let m,f,r,q,g,s
for (let i = 0; i < container.length - 1; i++){
m = container[i][0];
f = container[i][1];
r = container[i][2];
q = parseInt(m,10);
g = parseInt(f,10);
s = parseInt(r, 10);
let score = q + g;

if (q === -1 && g === -1 && s === -1) {
break;
} else {
if (q === -1 || g === -1) {
console.log('F');
} else if (score >= 80) {
console.log('A');
} else if (score >= 65) {
console.log('B');
} else if (score >= 50) {
console.log('C');
} else if (score >= 30 && s >=50) {
console.log('C');
} else if (score >= 30 && s < 50) {
console.log('D');
} else {
console.log('F');
}
}
}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
