import Control.Applicative

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

main :: IO ()
main = do
    [m, f, r] <- (map (read :: String -> Int) . words) <$> getLine
    if (m == -1 && f == -1 && r == -1)
    then return ()
    else do
        putStrLn $ grading m f r
        main