object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)

    while(true) {
      val m, f, r = scanner.nextInt

      if(m == -1 && f == -1 && r == -1) System.exit(0)
      if(m == -1 || f == -1 || m + f < 30) {
        println("F")
      } else if(m + f < 50 && r < 50) {
        println("D")
      } else if(m + f < 65) {
        println("C")
      } else if(m + f < 80) {
        println("B")
      } else {
        println("A")
      }
    }
  }
}
