import scala.io.StdIn.readLine

object Main extends App {
  var n:Array[Int] = readLine.split(" ").map(_.toInt)

  while( n(0) != -1 || n(1) != -1 || n(2) != -1 ) {
    val Array(m,f,r) = n
    val score = m+f
    var grade = ""

    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"

    println(grade)


    n = readLine.split(" ").map(_.toInt)
  }
}