object Main extends App {
  val scanner = new java.util.Scanner(System.in)

  val inputs = Iterator.continually {
    val m = scanner.nextInt()
    val f = scanner.nextInt()
    val r = scanner.nextInt()

    (m, f, r)
  }.takeWhile(_ != (-1, -1, -1))

  val outputs = inputs.map {
    case (m, f, r) =>
      val mf = m + f
      if(m < 0 || f < 0)
        "F"
      else if(mf >= 80)
        "A"
      else if(mf >= 65)
        "B"
      else if(mf >= 50)
        "C"
      else if(mf >= 30) {
        if(r >= 50)
          "C"
        else
          "D"
      } else "F"
  }

  outputs.foreach(println)
}