/**
  * http://judge.u-aizu.ac.jp/onlinejudge/topic.jsp?cid=ITP1#problems/ITP1_7
  */
object Main {
  def main(args: Array[String]): Unit = {
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).map(_.split(" ").map(_.toInt))
      .map { case Array(m, f, r) => (m, f, r) }
      .takeWhile(_ != (-1, -1, -1))
      .map {
        case (m, f, _) if m == -1 || f == -1 => "F"
        case (m, f, _) if 80 <= (m + f) => "A"
        case (m, f, _) if 65 until 80 contains (m + f) => "B"
        case (m, f, _) if 50 until 65 contains (m + f) => "C"
        case (m, f, r) if 30 until 50 contains (m + f) => if (r >= 50) "C" else "D"
        case (m, f, _) if (m + f) < 30 => "F"
      }
      .foreach(println)
  }
}