import Control.Applicative
import Data.Function
import Control.Monad

judge :: Int -> Int -> Int -> String
judge m f r
    | m == -1 || f == -1           = "F"
    | t >= 80                      = "A"
    | t < 80 && t >= 65            = "B"
    | t < 65 && t >= 50 || r >= 50 = "C"
    | t < 50 && t >= 30            = "D"
    | otherwise                    = "F"
    where
        t = m + f

main :: IO ()
main = fix $ \loop -> do
    [m,f,r] <- map read . words <$> getLine
    unless ([m,f,r] == [-1,-1,-1]) $ do
        putStrLn $ judge m f r
        loop
