fun judge(m: Int, f: Int, r: Int): Char {
    var result: Char
    val mf = m + f

    result = when {
        mf < 30 -> 'F'
        mf < 50 -> 'D'
        mf < 65 -> 'C'
        mf < 80 -> 'B'
        else -> 'A'
    }
    if (result == 'D' && r >= 50) {
        result = 'C'
    }
    if (Math.min(m, f) == -1) {
        result = 'F'
    }
    return result
}

fun main(args: Array<String>) {
    val ans = mutableListOf<Char>()
    while (true) {
        val (m, f, r) = readLine()!!.split(" ").map { it.toInt() }
        if (listOf(m, f, r).sum() == -3) {
            break
        }
        ans.add(judge(m, f, r))
    }
    println(ans.joinToString("\n"))
}

