import std.stdio, std.string, std.array, std.conv;

void main() {
    foreach (i; 0 .. 50) {
        int[] tmp = readln.chomp.split.to!(int[]);
        int m = tmp[0], f = tmp[1], r = tmp[2];
        if (m == -1 && f == -1 && r == -1) break;
        if (m == -1 || f == -1) {
            "F".writeln;
        } else if (m + f >= 80) {
            "A".writeln;
        } else if (m + f >= 65) {
            "B".writeln;
        } else if (m + f >= 50) {
            "C".writeln;
        } else if (m + f >= 30) {
            if (r >= 50) {
                "C".writeln;
            } else {
                "D".writeln;
            }
        } else {
            "F".writeln;
        }
    }
}
