import std.stdio,std.string,std.conv,std.array,std.algorithm;
void main(){
	for(;;){
		auto rcs = readln().chomp().split();
		auto scorelist = [to!int(rcs[0]),to!int(rcs[1]),to!int(rcs[2])];
		if( scorelist[0]==-1 && scorelist[1]==-1 && scorelist[2]==-1 ){
			break;
		}
		if( scorelist[0]==-1 || scorelist[1]==-1 ){
			writeln("F");
		} else if( 80 <= scorelist[0]+scorelist[1] ){
			writeln("A");
		} else if ( 65 <= scorelist[0]+scorelist[1] ) {
			writeln("B");
		} else if ( 50 <= scorelist[0]+scorelist[1] ) {
			writeln("C");
		} else if ( 30 <= scorelist[0]+scorelist[1] ) {
			if( 50 <= scorelist[2] ){
				writeln("C");
			} else{
				writeln("D");
			}
		} else {
			writeln("F");
		}
	}
}