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


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


} 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();
	} main {

		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();
	} Scanner scan=new Scanner(System.in); 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));

		} 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));

		} int mid_score=scan.nextInt(); mid_score scan.nextInt() scan.nextInt scan int final_score=scan.nextInt(); final_score scan.nextInt() scan.nextInt scan int re_score=scan.nextInt(); re_score scan.nextInt() scan.nextInt scan if(mid_score==-1&&final_score==-1&&re_score==-1){break;} mid_score==-1&&final_score==-1&&re_score==-1 mid_score==-1&&final_score==-1&&re_score==-1 mid_score==-1 mid_score -1 1 final_score==-1 final_score -1 1 re_score==-1 re_score -1 1 {break;} break; System.out.println(grading(mid_score, final_score, re_score)) System.out.println System.out System System.out grading(mid_score, final_score, re_score) grading mid_score final_score re_score scan.close() scan.close scan String[] args args 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;
	} grading {
		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;
	} char char_grading='0'; char_grading '0' int total_score=0; total_score 0 total_score=(mid_score+final_score) total_score (mid_score+final_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';
		} mid_score==-1||final_score==-1||total_score<30 mid_score==-1||final_score==-1||total_score<30 mid_score==-1 mid_score -1 1 final_score==-1 final_score -1 1 total_score<30 total_score 30 {
			char_grading='F';

		} char_grading='F' char_grading 'F' 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';
		} (total_score>=30&&total_score<50) && re_score<50 (total_score>=30&&total_score<50) total_score>=30 total_score 30 total_score<50 total_score 50 re_score<50 re_score 50 {
			char_grading='D';

		} char_grading='D' char_grading 'D' 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';
		} ((total_score>=30&&total_score<50) && re_score>=50) || (total_score>=50&&total_score<65) ((total_score>=30&&total_score<50) && re_score>=50) (total_score>=30&&total_score<50) total_score>=30 total_score 30 total_score<50 total_score 50 re_score>=50 re_score 50 (total_score>=50&&total_score<65) total_score>=50 total_score 50 total_score<65 total_score 65 {
			char_grading='C';
		} char_grading='C' char_grading 'C' if(total_score>=65&&total_score<80){
			char_grading='B';
		}else if(total_score>=80){
			char_grading='A';
		} total_score>=65&&total_score<80 total_score>=65 total_score 65 total_score<80 total_score 80 {
			char_grading='B';
		} char_grading='B' char_grading 'B' if(total_score>=80){
			char_grading='A';
		} total_score>=80 total_score 80 {
			char_grading='A';
		} char_grading='A' char_grading 'A' return char_grading; char_grading int mid_score mid_score int final_score final_score int re_score re_score 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;
	}


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


} Main
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;
	}


}