def grade(m, f, r)
  if m == -1 || f == -1
    puts "F"
  else
    puts case m + f
      when (0...30) then "F"
      when (30...50)
        if r >= 50
          "C"
        else
          "D"
        end
      when (50...65) then "C"
      when (65...80) then "B"
      when (80..100) then "A"
      end
  end
end

loop do
  m, f, r = gets.chomp.split(" ").map(&:to_i)
  break if [m, f, r] == [-1, -1, -1]
  grade(m, f, r)
end