import std.stdio: readln, writeln;
import std.string: chomp, split;
import std.conv: to;

void main()
{
    auto dataSet = chomp(readln()).split(" ");
    int m = to!int(dataSet[0]),
        f = to!int(dataSet[1]),
        r = to!int(dataSet[2]);
    while(1 + m || 1 + f || 1 + r)
    {
        if(0 == (1 + m) * (1 + f) || 30 > m + f) writeln("F");
        else if(80 <= m + f) writeln("A");
        else if(65 <= m + f) writeln("B");
        else if(50 <= m + f) writeln("C");
        else if(50 <= r) writeln("C");
        else writeln("D");
        dataSet = chomp(readln()).split(" ");
        m = to!int(dataSet[0]),
        f = to!int(dataSet[1]),
        r = to!int(dataSet[2]);
    }
}