import java.util.Scanner;

public class Main {

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

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

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int i = 1; i 1 while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		} i < 1000 i 1000 {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		} String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] string = line.split(" "); string line.split(" ") line.split line " " int m = Integer.parseInt(string[0]); m Integer.parseInt(string[0]) Integer.parseInt Integer string[0] string 0 int f = Integer.parseInt(string[1]); f Integer.parseInt(string[1]) Integer.parseInt Integer string[1] string 1 int r = Integer.parseInt(string[2]); r Integer.parseInt(string[2]) Integer.parseInt Integer string[2] string 2 if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} 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;

			} break; if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m == -1 || f == -1 || m + f < 30 m == -1 || f == -1 || m + f < 30 m == -1 m -1 1 f == -1 f -1 1 m + f < 30 m + f m f 30 {
				System.out.println("F");

			} System.out.println("F") System.out.println System.out System System.out "F" if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m + f >= 80 m + f m f 80 {
				System.out.println("A");

			} System.out.println("A") System.out.println System.out System System.out "A" if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m + f >= 65 && m + f < 80 m + f >= 65 m + f m f 65 m + f < 80 m + f m f 80 {
				System.out.println("B");

			} System.out.println("B") System.out.println System.out System System.out "B" if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m + f >= 50 && m + f < 65 m + f >= 50 m + f m f 50 m + f < 65 m + f m f 65 {
				System.out.println("C");

			} System.out.println("C") System.out.println System.out System System.out "C" if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m + f >= 30 && m + f < 50 && r >= 50 m + f >= 30 && m + f < 50 && r >= 50 m + f >= 30 m + f m f 30 m + f < 50 m + f m f 50 r >= 50 r 50 {
				System.out.println("C");

			} System.out.println("C") System.out.println System.out System System.out "C" if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			} m + f >= 30 && m + f < 50 m + f >= 30 m + f m f 30 m + f < 50 m + f m f 50 {
				System.out.println("D");

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

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

	}
} public class Main {

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

	}
} Main
import java.util.Scanner;

public class Main {

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

		int i = 1;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] string = line.split(" ");
			int m = Integer.parseInt(string[0]);
			int f = Integer.parseInt(string[1]);
			int r = Integer.parseInt(string[2]);

			if (m == -1 && f == -1 && r == -1) {
				break;

			} else if (m == -1 || f == -1 || m + f < 30) {
				System.out.println("F");

			} else if (m + f >= 80) {
				System.out.println("A");

			} else if (m + f >= 65 && m + f < 80) {
				System.out.println("B");

			} else if (m + f >= 50 && m + f < 65) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50 && r >= 50) {
				System.out.println("C");

			} else if (m + f >= 30 && m + f < 50) {
				System.out.println("D");

			}
			i++;
		}

	}
}