var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var row = input.split('\n');
var finalResult = [];
for(var i=0;i<row.length;i++){
    var result = row[i].split(' ').map(Number);
    var m = result[0];
    var f = result[1];
    var r = result[2];
    if(m === -1 && f === -1 && r === -1){
        break;
    }
    var total = m+f;
    if(m === -1 || f === -1){
        var grade = 'F';
        finalResult.push(grade);
    }
    else if(total >= 80){
        var grade = 'A';
        finalResult.push(grade);
    }
    else if(total >= 65 && total <80){
        var grade = 'B';
        finalResult.push(grade);
    }
    else if(total >=50 && total <65){
        var grade ='C';
        finalResult.push(grade);
    }
    else if(total >=30 && total <50 && r>=50){
        var grade ='C';
        finalResult.push(grade);
    }
    else if(total >=30 && total <50){
        var grade ='D';
        finalResult.push(grade);
    }
    else{
        var grade = 'F';
        finalResult.push(grade);
    }
}
console.log(finalResult.join('\n'));
