=begin
1, まずは中間期末で欠席を見る(F)
2, 次は中間期末の合計を見る(A~C)
3, 30 <= 合計 < 50 なら 50 <= 再試験 ? C : D
4, 合計 < 30 (F)
=end

while (m, f, r = gets.split.map(&:to_i)) != [-1, -1, -1] do
  if m == -1 || f == -1
    puts "F"
    next
  end
  
  sum = m + f
  if sum >= 80 then puts "A"
  elsif sum >= 65 then puts "B"
  elsif sum >= 50 then puts "C"
  elsif sum >= 30
    puts (r >= 50) ? "C" : "D"
  else puts "F" end
end
