import Control.Applicative
import Control.Monad

main = do
    a:b:c:_ <- map read .words <$> getLine ::IO[Int]
    let g = if a * b < 0 then "F"
                         else case a+b of
                                s | s >= 80 -> "A"
                                s | s >= 65 -> "B"
                                s | s >= 50 -> "C"
                                s | s >= 30 && c >= 50 -> "C"
                                s | s >= 30 -> "D"
                                _ -> "F"
    if (a > 0 || b > 0 || c > 0) 
      then do 
        putStrLn $ g
        main
      else return()