import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

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