while(str = gets)
  between,last,again = str.split.map{|ngo|ngo.to_i}
  exit(0) if between == -1 and last == -1 and again == -1
  if between == -1 or last == -1
    puts "F"
    next
  end
  if between + last >= 80
    puts "A"
  elsif between + last >= 65
    puts "B"
  elsif between + last >= 50
    puts "C"
  elsif  between + last >=30
    if again >= 50
      puts "C"
    else
      puts "D"
    end
  else
    puts "F"
  end
end
