while true do
	
	aryInputLines = gets.split.map(&:to_i);
	
	middleTestPoints = aryInputLines[0];
	termEndTestPoints = aryInputLines[1];
	retestPoints = aryInputLines[2];
	
	if middleTestPoints == -1 && termEndTestPoints == -1 && retestPoints == -1 then
		break;
	end
	
	if middleTestPoints == -1 || termEndTestPoints == -1 then
		puts "F";
	elsif middleTestPoints + termEndTestPoints >= 80 then
		puts "A";
	elsif 65 <= middleTestPoints + termEndTestPoints && middleTestPoints + termEndTestPoints < 80 then
		puts "B";
	elsif 50 <= middleTestPoints + termEndTestPoints && middleTestPoints + termEndTestPoints < 65 then
		puts "C";
	elsif 30 <= middleTestPoints + termEndTestPoints && middleTestPoints + termEndTestPoints < 50 then
		
		if retestPoints >= 50 then
			puts "C";
		else
			puts "D";
		end
	
	else
		puts "F";
	end
end