import std.stdio;
import std.conv;
import std.string;
import std.algorithm;

void main()
{
    auto n = map!(to!int)(readln.strip.split);

    while(n[0]!=-1 || n[1] != -1 || n[2] != -1) {
        string grade;
        int m=n[0],f=n[1],r=n[2],score=0;

        score = m+f;
        if(m==-1 || f ==-1)
        {
            grade = "F";
        }
        else if(score >= 80)
        {
            grade = "A";
        }
        else if(score < 80 && score >= 65)
        {
            grade = "B";
        }
        else if(score < 65 && score >= 50)
        {
            grade = "C";
        }
        else if(score < 50 && score >= 30)
        {
            if(r>=50)
                grade = "C";
            else
                grade = "D";
        }
        else
            grade = "F";

        writeln(grade);
        n = map!(to!int)(readln.strip.split);
    }
}