line = require('fs').readFileSync('/dev/stdin', 'ascii').split(/\r\n|\r|\n/);

for (i in line) {
	if (line[i] === '-1 -1 -1') break;
	mfr = line[i].split(' ').map(Number);
	judge(mfr);
}


function judge(mfr) {
	var m = mfr[0], f = mfr[1], r = mfr[2], mpf = m + f;
	if (m === -1 || f === -1) console.log('F');
	else if (mpf >= 80) console.log('A');
	else if (mpf >= 65) console.log('B');
	else if (mpf >= 50) console.log('C');
	else if (mpf < 30) console.log('F');
	else if (r >= 50) console.log('C');
	else console.log('D');
}