import Control.Applicative
main = do
    ns <- fmap (read :: String -> Int) . words <$> getLine
    let m = ns !! 0
        f = ns !! 1
        r = ns !! 2
    putResult m f r

putResult :: Int -> Int -> Int -> IO ()
putResult m f r
    | m == -1 && f == -1 && r == -1 = return ()
    | m == -1 || f == -1 = putStrLn "F" >> main
    | 80 <= sum_mf = putStrLn "A" >> main
    | 65 <= sum_mf && sum_mf < 80 =  putStrLn "B" >> main
    | 50 <= sum_mf && sum_mf < 65 = putStrLn "C" >> main
    | 30 <= sum_mf && sum_mf < 50 = putStrLn "D" >> main
    | sum_mf < 30 = putStrLn "F" >> main
    where
        sum_mf = m + f