import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    val result = mutableListOf<Char>()

    while(true){
	    val m = cin.nextInt()
	    val f = cin.nextInt()
	    val r = cin.nextInt()
    
	    if(m + f + r == -3) break

	    result.add(evaluate(m,f,r))
    }

    for(i in result.indices) println(result[i])
}

fun evaluate(m:Int, f:Int, r:Int):Char{

    var grade:Char
    val mf = m + f
 
    grade = when{
	    mf < 30 -> 'F'
	    mf < 50 -> 'D'
	    mf < 65 -> 'C'
	    mf < 80 -> 'B'
	    else -> 'A'
    }

    if(grade == 'D' && r >=50) grade = 'C'
    if(m == -1 || f == -1) grade = 'F'

    return grade
}
	


