import Control.Monad
import Control.Applicative

solve :: [Int] -> String
solve [-1, _, _] = "F"
solve [_, -1, _] = "F"
solve [a, b, c]
    | 80 <= (a+b) = "A"
    | 65 <= (a+b) = "B"
    | 50 <= (a+b) = "C"
    | 30 <= (a+b) && 50 <= c = "C"
    | 30 <= (a+b) = "D"
    | otherwise = "F"

main =
    mapM_ putStrLn =<< map solve . takeInputs . lines <$> getContents
    where
    takeInputs :: [String] -> [[Int]]
    takeInputs = takeWhile (not . all (== -1)) . map (map read . words)