var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
for(var i=0;i<Arr.length;i++){
var mfr=Arr[i].split(" ").map(Number);
var m=mfr[0];
var f=mfr[1];
var r=mfr[2];
if(m==-1 && f==-1 && r==-1)break;
if(m==-1 || f==-1){console.log("F");continue;}
if(m+f>=80){console.log("A");continue;}
if(m+f>=65){console.log("B");continue;}
if(m+f>=50){console.log("C");continue;}
if(m+f>=30 && r>=50){console.log("C");continue;}
if(m+f>=30){console.log("D");continue;}
if(m+f<30){console.log("F");continue;}
}