process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
    const n = chunk.toString();
    const r = n.split("\n").filter(x => x != "-1 -1 -1");
    r.forEach(x => sp(x));
});

function sp(tensu){
    const r = tensu.split(" ").map(x=>Number(x));
    const goukei = r[0]+r[1];
    if (goukei <30 || r[0]===-1 || r[1]===-1){
        return console.log("F");
    }else
    if (goukei>=80){
        return console.log("A");
    }
    if(goukei>=65 && goukei<80){
        return console.log("B");
    }
    if(goukei>=50 && goukei<65 || goukei>=30 && r[2]>=50){
        return console.log("C");
    }
    if(goukei>=30 && goukei<50){
        return console.log("D");
    }
}
