object Main extends App {
  val sc = new java.util.Scanner(System.in)
  execute(sc.nextInt(), sc.nextInt(), sc.nextInt())

  def execute(m: Int, f: Int, r: Int): Unit = {
    (m, f, r) match {
      case (-1, -1, -1) => sc.close()
      case _ =>
        printGrade((m,f,r))
        execute(sc.nextInt(), sc.nextInt(), sc.nextInt())
    }

    def printGrade(set: (Int, Int, Int)) = {
      set match {
        case _ if set._1 == -1 || set._2 == -1 || set._1 + set._2 < 30 => println("F")
        case _ if set._1 + set._2 >= 80 => println("A")
        case _ if set._1 + set._2 >= 65 => println("B")
        case _ if set._1 + set._2 >= 50 => println("C")
        case _ if set._1 + set._2 >= 30 => if (set._3 >= 50) println("C") else println("D")
      }
    }
  }
}