grading m f r | elem (-1) [m, f] = "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 = do
  [m, f, r] <- fmap (map read . words) getLine
  if [m, f, r] == [-1, -1, -1] then
    return ()
  else do
    putStrLn (grading m f r)
    main