def func(m, f, r)
  if m == -1 && f == -1
    puts "F"; return
  end
  case m + f
  when 80..100; puts "A"; return
  when 65..80; puts "B"; return
  when 50..65; puts "C"; return
  when 30..50
    if r >= 50
      puts "C"; return
    else
      puts "D"; return
    end
  else puts "F"; return
  end
end

while (m, f, r = gets.split(" ").map(&:to_i)) != [-1, -1, -1] do
  func(m, f, r)
end