
object Main {
  def main(args: Array[String]): Unit = {
    val in = new java.util.Scanner(System.in)
    val result = getResult(in)
    print(result)
  }
  def getResult(in:java.util.Scanner):String={
    val m = in.nextInt()
    val f = in.nextInt()
    val r = in.nextInt()
    if(m== -1 && f == -1 && r == -1){
      return ""
    }
    if(m == -1 || f == -1){
      return "F\n"+getResult(in)
    }else if(m+f >= 80){
      return "A\n" + getResult(in)
    }else if(m+f < 80 && m+f >= 65){
      return "B\n" + getResult(in)      
    }else if((m+f < 65 && m+f >=50) || (m+f < 50 && m+f >=30 && r >= 50) ){
      return "C\n" + getResult(in)     
    }else if(m+f < 50 && m+f >= 30){
      return "D\n" + getResult(in)     
    }else{
      return "F\n" + getResult(in)     
    }
  }
}