object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)
    Iterator.continually {(
      scanner.nextInt(),
      scanner.nextInt(),
      scanner.nextInt()
    )}.takeWhile {
      case (-1, -1, -1) => false
      case _ => true
    }.map {
      case (-1, _, _) => 'F'
      case (_, -1, _) => 'F'
      case (m, f, r) =>
        val sum = m + f
        if (80 <= sum) 'A'
        else if (65 <= sum) 'B'
        else if (50 <= sum) 'C'
        else if (30 <= sum) {
          if (50 <= r) 'C'
          else 'D'
        } else 'F'
    }.foreach(println)
  }
}