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

void main()
{
    while (1)
    {
        int a, b, c;
        readf("%d %d %d\n", &a, &b, &c);
        if (a == -1 && b == -1 && c == -1)
        {
            break;
        }
        if (a == -1 || b == -1){writeln("F");continue;}
        if (a + b >= 80)
        {
            writeln("A");
            continue;
        }
        if (a + b >= 65)
        {
            writeln("B");
            continue;
        }
        if (a + b >= 50)
        {
            writeln("C");
            continue;
        }
        if (a + b >= 30)
        {
            if (c >= 50)
                writeln("C");else
            writeln("D");
            continue;
        }writeln("F");
    }
}

