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