import java.util.Scanner;

public class Main {

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in); 

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char result; result int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		} ; 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 {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		} {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		} if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				result = 'F';
			} result = 'F' result 'F' if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			} m + f >= 80 m + f m f 80 {
				result = 'A';
			} result = 'A' result 'A' if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			} m + f >= 65 m + f m f 65 {
				result = 'B';
			} result = 'B' result 'B' if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			} m + f >= 50 m + f m f 50 {
				result = 'C';
			} result = 'C' result 'C' if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			} m + f >= 30 m + f m f 30 {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				} r >= 50 r 50 {
					result = 'C';
				} result = 'C' result 'C' {
					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 m = sc.nextInt() m sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc sc.close() sc.close sc String[] args args public class Main {

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	}
} public class Main {

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

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

		char result;

		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();

		for (; m != -1 || f != -1 || r != -1;) {
			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				if (r >= 50) {
					result = 'C';
				} else {
					result = 'D';
				}
			} else {
				result = 'F';
			}

			System.out.println(result);

			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		
		sc.close();
	}
}