main = do
    ss <- getLine
    let (m,f,r) = (ns!!0, ns!!1, ns!!2)
                    where ns = map (\x -> read x :: Int) $ words ss
    if m==(-1) && f==(-1) && r==(-1)
        then return ()
        else do
            putStrLn $ grade m f r
            main

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