import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

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

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	} main {

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<String> k = new ArrayList<String>(); k new ArrayList<String>() while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		} true {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		} String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc k.add(line) k.add k line if (line.equals("-1 -1 -1")) {
				break;
			} line.equals("-1 -1 -1") line.equals line "-1 -1 -1" {
				break;
			} break; for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		} String string k {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		} {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		} if (string.equals("-1 -1 -1")) {
				break;
			} string.equals("-1 -1 -1") string.equals string "-1 -1 -1" {
				break;
			} break; String[] sei = string.split(" "); sei string.split(" ") string.split string " " int[] v = new int[3]; v new int[3] 3 for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			} int i = 0; int i = 0; i 0 i < sei.length i sei.length sei sei.length i++ i++ i {
				v[i] = Integer.parseInt(sei[i]);
			} {
				v[i] = Integer.parseInt(sei[i]);
			} v[i] = Integer.parseInt(sei[i]) v[i] v i Integer.parseInt(sei[i]) Integer.parseInt Integer sei[i] sei i if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] == -1 || v[1] == -1 v[0] == -1 v[0] v 0 -1 1 v[1] == -1 v[1] v 1 -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] + v[1] >= 80 v[0] + v[1] v[0] v 0 v[1] v 1 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] + v[1] < 80 && v[0] + v[1] >= 65 v[0] + v[1] < 80 v[0] + v[1] v[0] v 0 v[1] v 1 80 v[0] + v[1] >= 65 v[0] + v[1] v[0] v 0 v[1] v 1 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] + v[1] < 65 && v[0] + v[1] >= 50 v[0] + v[1] < 65 v[0] + v[1] v[0] v 0 v[1] v 1 65 v[0] + v[1] >= 50 v[0] + v[1] v[0] v 0 v[1] v 1 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] + v[1] < 50 && v[0] + v[1] >= 30 v[0] + v[1] < 50 v[0] + v[1] v[0] v 0 v[1] v 1 50 v[0] + v[1] >= 30 v[0] + v[1] v[0] v 0 v[1] v 1 30 {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				} v[2] >= 50 v[2] v 2 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 (v[0] + v[1] < 30) {
				System.out.println("F");
			} v[0] + v[1] < 30 v[0] + v[1] v[0] v 0 v[1] v 1 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" String[] arges arges public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

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

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		List<String> k = new ArrayList<String>();
		while (true) {
			String line = sc.nextLine();
			k.add(line);
			if (line.equals("-1 -1 -1")) {
				break;
			}
		}
		for (String string : k) {
			if (string.equals("-1 -1 -1")) {
				break;
			}
			String[] sei = string.split(" ");
			int[] v = new int[3];
			for (int i = 0; i < sei.length; i++) {
				v[i] = Integer.parseInt(sei[i]);
			}
			if (v[0] == -1 || v[1] == -1) {
				System.out.println("F");
			} else if (v[0] + v[1] >= 80) {
				System.out.println("A");
			} else if (v[0] + v[1] < 80 && v[0] + v[1] >= 65) {
				System.out.println("B");
			} else if (v[0] + v[1] < 65 && v[0] + v[1] >= 50) {
				System.out.println("C");
			} else if (v[0] + v[1] < 50 && v[0] + v[1] >= 30) {
				if (v[2] >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else if (v[0] + v[1] < 30) {
				System.out.println("F");
			}

		}

	}

}