main =
  let 
    input = do
      line <- getLine
      let 
        [m,f,h] = (map read $ words line :: [Int])
        in calc m f h
    calc m f h
      | m+f+h == -3  = do
        putStr ""
      | m == -1 || f == -1  = do 
        putStrLn "F" 
        input
      | m+f >= 80  = do
        putStrLn "A"
        input
      | m+f >= 65  = do
        putStrLn "B"
        input
      | m+f >= 50 || ( m+f >= 30 && h >= 50 ) = do
        putStrLn "C"
        input
      | m+f >= 30  = do
        putStrLn "D"
        input
      | otherwise  = do
        putStrLn "F"
        input
    in
      input

