while ((m,f,r = gets.split(" ").map(&:to_i)).select{|i| i == -1}.length != 3) do
  if([m,f].select{|j| j == -1}.length != 0) || (m + f < 30)
    puts "F"
  else
    case (m + f)
    when 80..100
      puts "A"
    when 65...80
      puts "B"
    when 50...65
      puts "C"
    when 30...50
      puts (r >= 50) ? "C" : "D"
    end
  end
end