const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/);
input.pop();

 for (let i = 0; i < input.length; i++) {
     let [m, f, r] = input[i].split(' ').map(Number);
     let exam = m + f;
     if (m === -1 && f === -1 && r === -1) {
         break;
     } else if (m === -1 || f === -1) {
          console.log('F');
     } else if (exam >= 80) {
          console.log('A');
     } else if (80 > exam && exam >= 65) {
          console.log('B');
     } else if (65 > exam && exam >= 50) {
         console.log('C');
     } else if (50 > exam && exam >= 30 && r >= 50) {
         console.log('C');
     } else if (50 > exam && exam >= 30 && r < 50) {
         console.log('D');
     } else if (30 > exam) {
         console.log('F');
     }
 }
 
