import scala.io.StdIn

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {

    while(true){
      val in = StdIn.readLine().split(" ").map(_.toInt)
      if(in(0) == -1 && in(1) == -1 && in(2) == -1){return}
      println(getGrade(in(0),in(1),in(2)))
    }
  }

  def getGrade(m:Int,f:Int,r:Int): String = (m,f,r) match {
    case (m,f,_) if m == -1 || f == -1 || m + f < 30 => "F"
    case (m,f,_) if m + f >= 80 => "A"
    case (m,f,_) if m + f >= 65 && m + f < 80 => "B"
    case (m,f,r) if (m + f >= 50 && m + f < 65) || (m + f >= 30 && m + f < 50 && r >= 50) => "C"
    case (m,f,_) if m + f >= 30 && m + f < 50 => "D"
  }
}