import std.stdio;
import std.array;
import std.conv;


void main()
{
    while (1) {
        auto input = to!(int[])(split(readln()));
        int total = input[0] + input[1];
    
        if (input[0] == -1 && input[1] == -1 && input[2] == -1) break;

        if (input[0] == -1 || input[1] == -1) {
            writeln("F");
        } else if (total >= 80) {
            writeln("A");
        } else if (total >= 65) {
            writeln("B");
        } else if (total >= 50) {
            writeln("C");
        } else if (total >= 30) {
            if (input[2] >= 50)
                writeln("C");
            else
                writeln("D");
        } else {
            writeln("F");
        }
    }
}