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();
	}
} import java.util.Scanner; Scanner java.util 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();
	}
} 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();
	} main {
		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();
	} Scanner scan = new Scanner(System.in); 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");
		} 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");
		} int tyuukan = scan.nextInt(); tyuukan scan.nextInt() scan.nextInt scan int kimatu = scan.nextInt(); kimatu scan.nextInt() scan.nextInt scan int tuishi = scan.nextInt(); tuishi scan.nextInt() scan.nextInt scan 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"); tyuukan == -1 && kimatu == -1 && tuishi == -1 tyuukan == -1 && kimatu == -1 && tuishi == -1 tyuukan == -1 tyuukan -1 1 kimatu == -1 kimatu -1 1 tuishi == -1 tuishi -1 1 break; 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"); tyuukan == -1 || kimatu == -1 tyuukan == -1 tyuukan -1 1 kimatu == -1 kimatu -1 1 System.out.println("F") System.out.println System.out System System.out "F" 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"); tyuukan + kimatu >= 80 tyuukan + kimatu tyuukan kimatu 80 System.out.println("A") System.out.println System.out System System.out "A" 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"); tyuukan + kimatu >= 65 tyuukan + kimatu tyuukan kimatu 65 System.out.println("B") System.out.println System.out System System.out "B" 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"); tyuukan + kimatu >= 50 tyuukan + kimatu tyuukan kimatu 50 System.out.println("C") System.out.println System.out System System.out "C" 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"); tyuukan + kimatu >= 30 tyuukan + kimatu tyuukan kimatu 30 if(tuishi >= 50)//?????????D??????????????????????????????????????????????????°???50?????\????????´???????????????C???
					System.out.println("C");
				else
					System.out.println("D"); tuishi >= 50 tuishi 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" System.out.println("F") System.out.println System.out System System.out "F" scan.close() scan.close scan String[] args args 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();
	}
} 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();
	}
} Main
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();
	}
}