function main(input) {
  var temp = input.split('\n');
  for (var i = 0; i < temp.length; i++) {
    var temp2 = temp[i].split(' ').map(Number);
    var m = temp2[0];
    var f = temp2[1];
    var r = temp2[2];

    if (m == -1 && f == -1 && r == -1) {
      break;
    } else if (m == -1 || f == -1) {
      console.log('F');
    } else if ((m + f) >= 80) {
      console.log('A');
    } else if ((m + f) >= 65) {
      console.log('B');
    } else if ((m + f) >= 50) {
      console.log('C');
    } else if ((m + f) >=30) {
      if (r >= 50) {
        console.log('C');
      } else {
        console.log('D');
      }
    } else {
      console.log('F');
    }
  }
}

var x = require('fs').readFileSync('/dev/stdin', 'utf-8');
main(x);
