import scala.io.StdIn.readLine

object Main extends App {

  for (_ <- 0 to 50) {
    var Array(m, f, r) = readLine.split(" ").map(_.toInt)
    if ((m, f, r) == (-1, -1, -1)) sys.exit()
    if (m == -1 || f == -1) println("F") else {
      m + f match {
        case score if score >= 80 => println("A")
        case score if score >= 65 => println("B")
        case score if score >= 50 || (score < 50 && score >= 30 && r >= 50) => println("C")
        case score if score >= 30 && r < 50 => println("D")
        case _ => println("F")
      }
    }
  }

}
