import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);

		while(true){//?????????????????????????????§??\?????????????????°???????????????
			int tyuukan = scan.nextInt();//???????????????????????°
			int kimatu = scan.nextInt();//???????????????????????°
			int tuishi = scan.nextInt();//???????¨?????????°

			if(tyuukan == -1 && kimatu == -1 && tuishi == -1)//??\????????¨???-1??????????????????
				break;
			else if(tyuukan == -1 || kimatu == -1)//??????????????????????????????????¬????????????´???????????????F???
					System.out.println("F");
			else if(tyuukan + kimatu >= 80)//????????¨?????????????¨???????80?????\????????´???????????????A???
				System.out.println("A");
			else if(tyuukan + kimatu >= 65)//????????¨?????????????¨???????65~79????????´???????????????B???
				System.out.println("B");
			else if(tyuukan + kimatu >= 50)//????????¨?????????????¨???????50~64????????´???????????????C???
				System.out.println("C");
			else if(tyuukan + kimatu >= 30)//????????¨?????????????¨???????30~49????????´???????????????D???
				if(tuishi >= 50)//?????????D??????????????????????????????????????????????????°???50?????\????????´???????????????C???
					System.out.println("C");
				else
					System.out.println("D");
			else//????????¨?????????????¨???????30??????????????´???????????????D???
				System.out.println("F");
		}
		scan.close();
	}
}
/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