"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});
/* 入力は 
 */

var re = /\s+|$/;
reader.on('close', () => {
    var scores = [];
    var m,f,r;
    for (var line of lines) {
	[m,f,r] = line.trim().split(' ').map(Number);
	if (m==-1 && f==-1 && r==-1) {
	    break;
	}
	scores.push([m,f,r]);
    }
    
    console.log(aux(scores));
});

function aux(scores)
{
    var s = [];

    for (var score of scores) {
	let grade, m, f, r;
	[m,f,r] = score;
	if (m==-1 || f==-1) {
	    grade='F';
	} else if (m+f >= 80) {
	    grade='A';
	} else if (m+f >= 65) {
	    grade='B';
	} else if (m+f >= 50) {
	    grade='C';
	} else if (m+f >= 30 && r>=50) {
	    grade='C';
	} else if (m+f >= 30) {
	    grade='D';
	} else {
	    grade='F';
	}

	s.push(grade);
    }

    return(s.map(String).join('\n'));
}
