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

void main(){
	while(1){
  	auto a=map!(to!int)(readln.chomp.split);
  	int m=a[0],f=a[1],r=a[2];
  	if(m<0&&f<0&&r<0)break;
  	if(m<0||f<0)writeln("F");
  	else if(80<=m+f)writeln("A");
  	else if(65<=m+f)writeln("B");
  	else if(50<=m+f)writeln("C");
  	else if(30<=m+f)writeln(((r>=50)?"C":"D"));
  	else writeln("F");
  }
}