object Main extends App {
  scala.io.Source.stdin.getLines.toList.init
    .map(_.split(" ").toList.map(_.toInt))
    .map{
      case List(-1, _, _) => "F"
      case List(_, -1, _) => "F"
      case List(a, b, c) if a + b < 30 => "F"
      case List(a, b, c) if a + b < 50 & c < 50 => "D"
      case List(a, b, c) if a + b < 65 => "C"
      case List(a, b, c) if a + b < 80 => "B"
      case _ => "A"
    }
    .map(println)
}