loop do
 tests = gets.split.map &:to_i
 if tests[0] + tests[1] + tests[2] == -3
  exit
 elsif tests[0] == -1 || tests[1] == -1
  puts :F
 else
  score = tests[0] + tests[1]
  if score >= 80
   puts :A
  elsif score >= 65
   puts :B
  elsif score >= 50
   puts :C
  elsif score >= 30
   puts tests[2] >= 50 ? :C: :D
  else
   puts :F
  end
 end
end
