import scala.io.StdIn._

object Main {
  def main(args: Array[String]) {
    def testResultPrint(test: String): Unit ={
      val Array(test1, test2, test3) = test.split(" ").map(_.toInt)
      val testResult = testCheck(test1, test2, test3)
      if(testResult != "end") {
        println(testResult)
        testResultPrint(readLine())
      }
    }

    def testCheck(t1: Int, t2: Int, t3: Int): String = {
      val t12 = t1 + t2
      if(t1 + t2 + t3 == -3) "end"
      else if(t1 == -1 || t2 == -1 || t12 < 30) "F"
      else if(t12 >= 80) "A"
      else if(t12 >= 65) "B"
      else if(t12 >= 50 || (t12 >= 30 && t3 >= 50)) "C"
      else if(t12 >= 30) "D"
      else "end"
    }

    testResultPrint(readLine())
  }
}