//??°????????????????±???????????????°??????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz