function Main(input) {
    input = input.split("\n");
    for (i=0; i < input.length; i++) {
        tmp = input[i].split(" ")
        var m = parseInt(tmp[0])
        var f = parseInt(tmp[1])
        var r = parseInt(tmp[2])
        var a = m+f
        if (m === -1 && f === -1 && r === -1) {
            break
        }
        if (m === -1 || f === -1) {
            console.log('F')
        } else if (a >= 80) {
            console.log('A')
        } else if (a >= 65) {
            console.log('B')
        } else if (a >= 50) {
            console.log('C')
        } else if (a >= 30) {
            if (r >= 50) {
                console.log('C')
            } else {
                console.log('D')
            }
        } else {
            console.log('F')
        }
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

