object Main {
  def main(args:Array[String]) {
    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 => 
      if (s._1 == -1 || s._2 == -1) println("F")

      val m = if (s._1 == -1) 0 else s._1
      val f = if (s._2 == -1) 0 else s._2
      val r = if (s._3 == -1) 0 else s._3
      
      (m, f, r) match {
        case (m, f, r) if (m + f) >= 80 => println("A")
        case (m, f, r) if ((m + f) < 80 && (m + f) >= 65) => println("B")
        case (m, f, r) if ((m + f) < 65 && (m + f) >= 50) => println("C")
        case (m, f, r) if ((m + f) < 50 && (m + f) >= 30 && r >= 50) => println("C")
        case (m, f, r) if ((m + f) < 50 && (m + f) >= 30) => println("D")
        case (m, f, r) if ((m + f) < 30) => println("F")
        case _ => println("F")
      }

    }
  }
}