ans = ""
loop do
  m, f, r = gets.chomp.split.map(&:to_i)
  break if m == -1 && f == -1 && r == -1
  ans = ""
  if m == -1 || f == -1
    ans = "F"
  elsif m + f >= 80
    ans = "A"
  elsif m + f >= 65
    ans = "B"
  elsif m + f >= 50
    ans = "C"
  elsif m + f >= 30
    ans = "D"
    if r >= 50
      ans = "C"
    end
  else
    ans = "F"
  end
  puts ans
end

