import java.util.Scanner;

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

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


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

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	} main {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		} true {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		} int tyukan = sc.nextInt(); tyukan sc.nextInt() sc.nextInt sc int kimatu = sc.nextInt(); kimatu sc.nextInt() sc.nextInt sc int saisi = sc.nextInt(); saisi sc.nextInt() sc.nextInt sc String result = ""; result "" if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			} tyukan == -1 && kimatu == -1 && saisi == -1 tyukan == -1 && kimatu == -1 && saisi == -1 tyukan == -1 tyukan -1 1 kimatu == -1 kimatu -1 1 saisi == -1 saisi -1 1 {
				break;
			} break; if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			} tyukan == -1 || kimatu == -1 tyukan == -1 tyukan -1 1 kimatu == -1 kimatu -1 1 {
				result = "F";
			} result = "F" result "F" {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			} if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				} tyukan + kimatu >= 80 tyukan + kimatu tyukan kimatu 80 {
					result = "A";
				} result = "A" result "A" if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				} tyukan + kimatu >= 65 tyukan + kimatu tyukan kimatu 65 {
					result = "B";
				} result = "B" result "B" if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				} (tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50) (tyukan + kimatu >= 50) tyukan + kimatu tyukan kimatu 50 (tyukan + kimatu >= 30 && saisi >= 50) tyukan + kimatu >= 30 tyukan + kimatu tyukan kimatu 30 saisi >= 50 saisi 50 {
					result = "C";
				} result = "C" result "C" if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				} tyukan + kimatu >= 30 tyukan + kimatu tyukan kimatu 30 {
					result = "D";
				} result = "D" result "D" {
					result = "F";
				} result = "F" result "F" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	}
} Main
import java.util.Scanner;

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

		while(true) {
			int tyukan = sc.nextInt();
			int kimatu = sc.nextInt();
			int saisi = sc.nextInt();
			String result = "";
			if(tyukan == -1 && kimatu == -1 && saisi == -1) {
				break;
			} else if (tyukan == -1 || kimatu == -1){
				result = "F";
			} else {
				if(tyukan + kimatu >= 80) {
					result = "A";
				} else if(tyukan + kimatu >= 65) {
					result = "B";
				} else if((tyukan + kimatu >= 50) || (tyukan + kimatu >= 30 && saisi >= 50)) {
					result = "C";
				} else if(tyukan + kimatu >= 30) {
					result = "D";
				} else {
					result = "F";
				}

			}

			System.out.println(result);
		}


	}
}