import std.stdio;
void main() {
	for (;;) {
		int m, f, r;
		"%d %d %d\n".readf(&m, &f, &r);
		if (m == -1 && f == -1 && r == -1) break;
		string g = "";
		int s = m + f;
		if (m == -1 || f == -1) g = "F";
		else if (s >= 80) g = "A";
		else if (65 <= s && s < 80) g = "B";
		else if (50 <= s && s < 65) g = "C";
		else if (30 <= s && s < 65) g = r >= 50 ? "C" : "D";
		else g = "F";
		g.writeln;
	}
}