import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		}

	}

}
 import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		}

	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		}

	} main {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		}

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		} true {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		} int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int r = scanner.nextInt(); r scanner.nextInt() scanner.nextInt scanner if (m == -1 && f == -1 && r == -1)
				break; 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 break; char grade = 'F'; grade 'F' if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			} m < 0 || f < 0 m < 0 m 0 f < 0 f 0 {
				grade = 'F';
			} grade = 'F' grade 'F' if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			} m + f >= 80 m + f m f 80 {
				grade = 'A';
			} grade = 'A' grade 'A' if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			} m + f >= 65 m + f m f 65 {
				grade = 'B';
			} grade = 'B' grade 'B' if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			} m + f >= 50 m + f m f 50 {
				grade = 'C';
			} grade = 'C' grade 'C' if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			} m + f >= 30 m + f m f 30 {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				} r < 50 r 50 {
					grade = 'D';
				} grade = 'D' grade 'D' {
					grade = 'C';
				} grade = 'C' grade 'C' {
				grade = 'F';
			} grade = 'F' grade 'F' System.out.println(grade) System.out.println System.out System System.out grade String[] args args
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			if (m == -1 && f == -1 && r == -1)
				break;
			
			char grade = 'F';
			
			if (m < 0 || f < 0) {
				grade = 'F';
			} else if (m + f >= 80) {
				grade = 'A';
			} else if (m + f >= 65) {
				grade = 'B';
			} else if (m + f >= 50) {
				grade = 'C';
			} else if (m + f >= 30) {
				if (r < 50) {
					grade = 'D';
				} else {
					grade = 'C';
				}
			} else {
				grade = 'F';
			}
			
			System.out.println(grade);
		}

	}

}

