import std.stdio,
       std.string,
       std.conv,
       std.algorithm,
       std.range;

void main(){
	int m, f, r;
	string rs;
	while(true){
		scanf("%d %d %d", &m, &f, &r);
		if (m == -1 && f == -1 && r == -1) break;
		
		if (m == -1 || f == -1){
			rs ~= "F";
		} else if (m+f>=80){
			rs ~= "A";
		} else if (m+f>=65){
			rs ~= "B";
		} else if (m+f>=50){
			rs ~= "C";
		} else if (m+f>=30){
			if (r >= 50){
				rs ~= "C";
			}else{
				rs ~= "D";
			}
		} else {
			rs ~= "F";
		}
		rs ~= "\r\n";
	}
	writeln(rs.chomp);

}