import Control.Monad
import Control.Applicative

readDigits = map read <$> words <$> getLine :: IO [Int]

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 :: IO ()
main =
    loop
    where
    loop = do
        abc <- readDigits
        unless (all (== -1) abc) $ do
            putStrLn $ solve abc
            loop