object Main {
  def main(args:Array[String]): Unit = {
    Iterator.continually(readLine())
    .map(s => {
      val xs = s.split(" ").map(_.toInt)
      (xs(0), xs(1), xs(2))
    })
    .takeWhile{
      case (-1, -1, -1) => false
      case _ => true
    }
    .map{s => 
      val a = (s._1, s._2, s._3) match {
        case (-1, _, _) => "F"
        case (_, -1, _) => "F"
        case (m, f, r) if (m + f) >= 80 => "A"
        case (m, f, r) if ((m + f) < 80 && (m + f) >= 65) => "B"
        case (m, f, r) if ((m + f) < 65 && (m + f) >= 50) => "C"
        case (m, f, r) if ((m + f) < 50 && (m + f) >= 30 && r >= 50) => "C"
        case (m, f, r) if ((m + f) < 50 && (m + f) >= 30) => "D"
        case (m, f, r) if ((m + f) < 30) => "F"
      }
      println(a)
    }
  }
}