ans = []

while true
	points = gets.split(" ").map{ |e| e.to_i }
	break if points[0] == -1 && points[1] == -1 && points[2] == -1
	if points[0] == -1 || points[1] == -1
		ans.push "F"
	elsif points[0] + points[1] >= 80
		ans.push "A"
	elsif points[0] + points[1] >= 65
		ans.push "B"
	elsif points[0] + points[1] >= 50
		ans.push "C"
	elsif points[0] + points[1] >= 30
		if points[2] >= 50
			ans.push "C"
		else
			ans.push "D"
		end
	elsif points[0] + points[1] < 30
		ans.push "F"
	end
end

ans.each{ |e| puts e }