

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

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

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	}
} Main public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	} main {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		} true {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		} int middle = in.nextInt(); middle in.nextInt() in.nextInt in int term_end = in.nextInt(); term_end in.nextInt() in.nextInt in int retest = in.nextInt(); retest in.nextInt() in.nextInt in int sum = middle + term_end; sum middle + term_end middle term_end if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} middle == -1 && term_end == -1 && retest == -1 middle == -1 && term_end == -1 && retest == -1 middle == -1 middle -1 1 term_end == -1 term_end -1 1 retest == -1 retest -1 1 {

				break;

			} break; if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} middle == -1 || term_end == -1 middle == -1 middle -1 1 term_end == -1 term_end -1 1 {

				System.out.println("F");

			} System.out.println("F") System.out.println System.out System System.out "F" if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} sum >= 80 sum 80 {

				System.out.println("A");

			} System.out.println("A") System.out.println System.out System System.out "A" if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} sum < 80 && sum >= 65 sum < 80 sum 80 sum >= 65 sum 65 {

				System.out.println("B");

			} System.out.println("B") System.out.println System.out System System.out "B" if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} sum < 65 && sum >= 50 sum < 65 sum 65 sum >= 50 sum 50 {

				System.out.println("C");

			} System.out.println("C") System.out.println System.out System System.out "C" if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			} sum < 50 && sum >= 30 sum < 50 sum 50 sum >= 30 sum 30 {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			} if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				} retest >=  50 retest 50 {

					System.out.println("C");

				} System.out.println("C") System.out.println System.out System System.out "C" {

					System.out.println("D");

				} System.out.println("D") System.out.println System.out System System.out "D" if(sum < 30) {

				System.out.println("F");

			} sum < 30 sum 30 {

				System.out.println("F");

			} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	}
} public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	}
} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		while(true) {

			int middle = in.nextInt();
			int term_end = in.nextInt();
			int retest = in.nextInt();
			int sum = middle + term_end;

			if(middle == -1 && term_end == -1 && retest == -1) {

				break;

			}else if(middle == -1 || term_end == -1) {

				System.out.println("F");

			}else if(sum >= 80) {

				System.out.println("A");

			}else if(sum < 80 && sum >= 65) {

				System.out.println("B");

			}else if(sum < 65 && sum >= 50) {

				System.out.println("C");

			}else if(sum < 50 && sum >= 30) {

				if(retest >=  50) {

					System.out.println("C");

				}else {

					System.out.println("D");

				}

			}else if(sum < 30) {

				System.out.println("F");

			}
		}
	}
}