loop do
	m,f,r = gets.chomp.split(" ").map(&:to_i)
	break if m == -1 && f == -1 && r == -1
	
	if m == -1 || f == -1
		puts "F"
		next
	elsif m + f >= 80
		puts "A"
		next
	elsif m + f >= 65 && m + f < 80
		puts "B"
		next
	elsif m + f >= 50 && m + f < 65
		puts "C"
		next
	elsif m + f >= 30 && m + f < 50
		if r >= 50
			puts "C"
		else
			puts "D"
		end
		next
	elsif m + f < 30
		puts "F"
		next
	end
end