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

int main(string[] argv)
{
  while (1)
  {
    auto s = readln().chomp().split().map!(to!int);
    int mf = s[0] + s[1];
    if (s[0] + s[1] + s[2] == -3) break;
    if (s[0] == -1 || s[1] == -1) writeln("F");
    else if (80 <= mf) writeln("A");
    else if (65 <= mf) writeln("B");
    else if (50 <= mf) writeln("C");
    else if (30 <= mf)
      if (50 <= s[2]) writeln("C");
      else writeln("D");
    else writeln("F");
  }
  return 0;
}