import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.print(" ");
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> mid = new ArrayList<Integer>();
		ArrayList<Integer> fin = new ArrayList<Integer>();
		ArrayList<Integer> rex = new ArrayList<Integer>();
//		int n =scan.nextInt();
//		int m =scan.nextInt();
		int m=0;
		int f=0;
		int r=0;
		int score =0;
		while(m != -1 || f!= -1 || r != -1){
			m =scan.nextInt();
			f =scan.nextInt();
			r =scan.nextInt();
			mid.add(m);
			fin.add(f);
			rex.add(r);
//			System.out.println("scaning");
		}
//		System.out.println("finir");
		for (int i=0;i<mid.size()-1;i++){
			score = mid.get(i) + fin.get(i);
			if (mid.get(i) == -1 ||fin.get(i) == -1){	//??????????¨??????????????¨????????????????????¬????????????´???????????? F???
				System.out.println("F");
			}
			else if(score >= 80){	//??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
				System.out.println("A");
			}
			else if(score >= 65){	//??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
				System.out.println("B");
			}
			else if(score >= 50){	//??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
				System.out.println("C");
			}
			else if(rex.get(i) >=50){	//???????¨?????????°??? 50 ??\???????????°????????? C???
				System.out.println("C");
			}
			else if(score >= 30){	//??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D
				System.out.println("D");
			}
			else{	//??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???
				System.out.println("F");
			}
		}
	}
}
/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