object Main extends App {
	
	override def main(args:Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		
		Iterator.continually(new Scores(sc.nextInt,sc.nextInt,sc.nextInt)).
		takeWhile(_.isContinue).foreach{s => println(s.getGrade)}
	}
	
	case class Scores(val m:Int, val f:Int, val r:Int){
		val isContinue = !( m == -1 && f == -1 && r == -1 )

		val getGrade = (m,f,r) match{
			// ??????????¨??????????????¨????????????????????¬????????????´???????????? F???
			case (-1 , _ , _) | (_ , -1 , _ ) 
				=> "F"
			// ??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
			case (mm,ff,_) if mm + ff >= 80
				=> "A"
			// ??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
			case (mm,ff,_) if mm + ff >= 65
				=> "B"
			// ??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
			case (mm,ff,_) if mm + ff >= 50
				=> "C"
			// ??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
			case (mm,ff,rr) if mm + ff >= 30 && rr >= 50
				=> "C"
			case (mm,ff,_) if mm + ff >= 30
				=> "D"
			// ??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F
			case _
				=> "F"
		} 
	}
}