module Main where

import Data.Functor

main :: IO ()
main = do
  { [m,f,r] <- getInts
  ; if all (-1 ==) [m,f,r] then done
    else putStrLn
      ( if m == (-1) || f == (-1) then "F"
        else if m+f >= 80 then "A"
             else if m+f >= 65 then "B"
                  else if m+f >= 50 then "C"
                       else if m+f >= 30 then if r >= 50 then "C" else "D"
                            else "F"
      ) >> main
  }

done :: IO ()
done = return ()

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