import java.io.IOException;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		}
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		} true {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		} String [] line = scanner.nextLine().split(" "); line scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int m = Integer.parseInt(line[0]); m Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int f = Integer.parseInt(line[1]); f Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int totalTest = m + f; totalTest m + f m f int r = Integer.parseInt(line[2]); r Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 if (totalTest + r == -3) {
				break;
			} totalTest + r == -3 totalTest + r totalTest r -3 3 {
				break;
			} break; if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			} totalTest < 30 ||m == -1 || f == -1 totalTest < 30 ||m == -1 || f == -1 totalTest < 30 totalTest 30 m == -1 m -1 1 f == -1 f -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			} if (totalTest >= 80)
					System.out.println("A"); totalTest >= 80 totalTest 80 System.out.println("A") System.out.println System.out System System.out "A" if (totalTest < 80 && totalTest >= 65)
					System.out.println("B"); totalTest < 80 && totalTest >= 65 totalTest < 80 totalTest 80 totalTest >= 65 totalTest 65 System.out.println("B") System.out.println System.out System System.out "B" if (totalTest < 65 && totalTest >= 50)
					System.out.println("C"); totalTest < 65 && totalTest >= 50 totalTest < 65 totalTest 65 totalTest >= 50 totalTest 50 System.out.println("C") System.out.println System.out System System.out "C" if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C"); totalTest >= 30 && totalTest < 50 && r >= 50 totalTest >= 30 && totalTest < 50 && r >= 50 totalTest >= 30 totalTest 30 totalTest < 50 totalTest 50 r >= 50 r 50 System.out.println("C") System.out.println System.out System System.out "C" if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D"); totalTest >= 30 && totalTest < 50 && r < 50 totalTest >= 30 && totalTest < 50 && r < 50 totalTest >= 30 totalTest 30 totalTest < 50 totalTest 50 r < 50 r 50 System.out.println("D") System.out.println System.out System System.out "D" String[] args args
import java.io.IOException;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			String [] line = scanner.nextLine().split(" ");
			int m = Integer.parseInt(line[0]);
			int f = Integer.parseInt(line[1]);
			int totalTest = m + f;
			int r = Integer.parseInt(line[2]);
			if (totalTest + r == -3) {
				break;
			}
			if (totalTest < 30 ||m == -1 || f == -1) {
				System.out.println("F");
			} else {
				if (totalTest >= 80)
					System.out.println("A");
				if (totalTest < 80 && totalTest >= 65)
					System.out.println("B");
				if (totalTest < 65 && totalTest >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r >= 50)
					System.out.println("C");
				if (totalTest >= 30 && totalTest < 50 && r < 50)
					System.out.println("D");
			}
		}
	}
}