import Data.Functor ((<$>))

grade :: Int -> Int -> Int -> Char
grade m f r
  | m == -1 || f == -1 = 'F'
  | m + f < 30         = 'F'
  | m + f < 50         = if r >= 50 then 'C' else 'D'
  | m + f < 65         = 'C'
  | m + f < 80         = 'B'
  | otherwise          = 'A'

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

