import Control.Applicative
import Control.Monad
import Data.Array
import Data.Array.ST
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Text.Printf

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

main :: IO ()
main = do
  [m,f,r] <- readInts
  when ((m,f,r) /= (-1,-1,-1)) $ do
    putChar $ solve m f r
    putChar '\n'
    main

solve :: Int -> Int -> Int -> Char
solve (-1) _ _  = 'F'
solve _ (-1) _  = 'F'
solve m f r
  | m + f <  30 = 'F'
  | m + f >= 80 = 'A'
  | m + f >= 65 = 'B'
  | m + f >= 50 = 'C'
  | r >= 50     = 'C'
  | otherwise   = 'D'

