i = 0
m = Array.new
f = Array.new
r = Array.new
while m[i-1] != -1 || f[i-1] != -1 || r[i-1] != -1 do
	m[i], f[i], r[i] = gets.split.map(&:to_i)
	i += 1
end
i = 0
while m[i] != -1 || f[i] != -1 || r[i] != -1 do
	if m[i] == -1 || f[i] == -1
		puts "F"
	elsif m[i] + f[i] >= 80
		puts "A"
	elsif 80 > m[i] + f[i] && m[i] + f[i] >= 65
		puts "B"
	elsif 65 > m[i] + f[i] && m[i] + f[i] >= 50 || r[i] >= 50
		puts "C"
	elsif 50 > m[i] + f[i] && m[i] + f[i] >= 30
		puts "D"
	else
		puts "F"
	end
	i += 1
end