main = do
  s <- getLine
  let [m,f,r] = map (read::String->Int) . words $ s
  if m /= -1 || f /= -1 || r /= -1 then
    let score = m+f
        grade = do
            if m == -1 || f == -1
                then "F"
                else if score >= 80 then "A"
                else if score < 80 && score >= 65 then "B"
                else if score < 65 && score >= 50 then "C"
                else if score < 50 && score >= 30 then
                  if r>=50 then "C"
                  else "D"
                else "F"
    in do
    putStrLn grade
    main
  else
      return ()