import Control.Applicative
import Data.List

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

getLines :: IO [[Int]]
getLines = do
  [m, f, r] <- readInts
  if m == -1 && f == -1 && r == -1
     then return []
     else do
       rest <- getLines
       return ([m, f, r] : rest)

calc :: Int -> Int -> Int -> String
calc m f r
  | m == -1 || m == -1 = "F"
  | m + f >= 80 = "A"
  | m + f >= 65 = "B"
  | m + f >= 50 = "C"
  | m + f >= 30 = if r >= 50 then "C" else "D"
  | otherwise = "F"

main :: IO ()
main = do
  xs <- getLines
  putStrLn $ intercalate "\n" [calc m f r | [m, f, r] <- xs]