loop do
  line = gets.chomp.split
  m = line[0].to_i
  f = line[1].to_i
  r = line[2].to_i

  break if m == -1 && f == -1 && r == -1

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