while true
  m, l, r = gets.chomp.split.map(&:to_i)
  break if m == -1 && l == -1 && r == -1

  if m == -1 || l == -1
    puts 'F'
  elsif m + l >= 80
    puts 'A'
  elsif m + l >= 65
    puts 'B'
  elsif m + l >= 50 || r >= 50
    puts 'C'
  elsif m + l >= 30
    puts 'D'
  else
    puts 'F'
  end
end

