function main(input){
    let lines = input.split("\n");
    let i=0;
    while(lines[i]!=="-1 -1 -1"){
        let nums = api(lines[i].split(" "));
        let sum = nums[0]+nums[1];
        if(nums[0]===-1 || nums[1]===-1){
            console.log("F");
        }else if(sum>=80){
            console.log("A");
            
        }else if(sum>=65){
            console.log("B");
        }else if(sum>=50){
            console.log("C");
        }else if(sum>=30){
            if(nums[2]>=50){
                console.log("C");
            }else{
                console.log("D");
            }
        }else{
            console.log("F");
        }
        i++;
    }
    
}
function api(arr){
    return arr.map(item=>parseInt(item));
}


main(require("fs").readFileSync("/dev/stdin","utf-8"));
