import Control.Monad
func x = do
  mfr_in <- (return. map (read::String->Int) . words) =<< getLine
  let m:f:r:[] = mfr_in
  if (m==(-1)) && (f==(-1)) && (r==(-1))
    then return () else do
      score m f r
      func x

score m f r | (m == -1) || (f == -1)   = putStrLn "F"
            | (m + f) >= 80            = putStrLn "A"
            | (m + f) >= 65            = putStrLn "B"
            | (m + f) >= 50            = putStrLn "C"
            | (m + f) >= 30 && r >= 50 = putStrLn "C"
            | (m + f) >= 30            = putStrLn "D"
            | otherwise                = putStrLn "F"

main = func 0
