object Main {

    def main(args: Array[String]): Unit = {
        val sc = new java.util.Scanner(System.in)

        grade(sc)
    }

    def grade(scanner: java.util.Scanner): Unit = {
        val m, f, r = scanner.nextInt

        if( m != -1 || f != -1 || r != -1 ) {
            (m, f, r) match {
                case (-1, _, _) => println("F")
                case (_, -1, _) => println("F")
                case _ => {
                    m+f match {
                        case a if a >= 80 => println("A")
                        case b if b >= 65 => println("B")
                        case c if c >= 50 => println("C")
                        case d if d >= 30 => {
                            println(if( r >= 50 ) "C" else "D")
                        }
                        case _ => println("F")
                    }
                }
            }

            grade(scanner)
        }
    }
}

