import std.stdio;
import std.string;
import std.algorithm;
import std.conv;
import std.array;
import std.math;
import std.range;

void main()
{
    while(1)
    {
        auto mfr = readln.chomp.split.map!(to!int).array;
        if(mfr == [-1, -1, -1]) return;

        if(mfr[0 .. 2].count(-1)) writeln("F");
        else{
            int smf = reduce!"a+b"(0, mfr[0 .. 2]);
            if(smf >= 80) writeln("A");
            else if(smf >= 65 && smf < 80) writeln("B");
            else if(smf >= 50 && smf < 65) writeln("C");
            else if(smf >= 30 && smf < 50) writeln(mfr[2] >= 50 ? "C" : "D");
            else writeln("F");
        }
    }
}