import java.util.Scanner;



public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		while(true){
		int mid_score=scan.nextInt();
		int final_score=scan.nextInt();
		int re_score=scan.nextInt();

		if(mid_score==-1&&final_score==-1&&re_score==-1){break;}

		System.out.println(grading(mid_score, final_score, re_score));

		}

		scan.close();
	}

	public static char grading(int mid_score, int final_score, int re_score){
		char char_grading='0';
		int total_score=0;
		total_score=(mid_score+final_score);

		if(mid_score==-1||final_score==-1||total_score<30){
			char_grading='F';

		}else if((total_score>=30&&total_score<50) && re_score<50){
			char_grading='D';

		}else if(((total_score>=30&&total_score<50) && re_score>=50) || (total_score>=50&&total_score<65)){
			char_grading='C';
		}else if(total_score>=65&&total_score<80){
			char_grading='B';
		}else if(total_score>=80){
			char_grading='A';
		}




		return char_grading;
	}


}
/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