while (m, f, r = gets.split.map(&:to_i)) != [-1, -1, -1] do
	if m == -1 || f == -1 then
		puts 'F'
	else
		sum = m + f

		if sum >= 80 then
			puts 'A'
		elsif sum < 80 && sum >= 65 then
			puts 'B'
		elsif sum < 65 && sum >= 50 then
			puts 'C'
		elsif sum < 50 && sum >= 30 then
			if r >= 50 then
				puts 'C'
			else
				puts 'D'
			end
		else
			puts 'F'
		end
	end
end