
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	} main {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		} true {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		} int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner if (a == -1 && b == -1 && c == -1)
				break; a == -1 && b == -1 && c == -1 a == -1 && b == -1 && c == -1 a == -1 a -1 1 b == -1 b -1 1 c == -1 c -1 1 break; if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F"); a == -1 || b == -1 a == -1 a -1 1 b == -1 b -1 1 System.out.println("F") System.out.println System.out System System.out "F" if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F"); a + b >= 80 a + b a b 80 System.out.println("A") System.out.println System.out System System.out "A" if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F"); a + b >= 65 a + b a b 65 System.out.println("B") System.out.println System.out System System.out "B" if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F"); a + b >= 50 a + b a b 50 System.out.println("C") System.out.println System.out System System.out "C" if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F"); a + b >= 30 a + b a b 30 if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D"); c >= 50 c 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" 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 scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int c = scanner.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			if (a == -1 || b == -1)
				System.out.println("F");
			else if (a + b >= 80)
				System.out.println("A");
			else if (a + b >= 65)
				System.out.println("B");
			else if (a + b >= 50)
				System.out.println("C");
			else if (a + b >= 30)
				if (c >= 50)
					System.out.println("C");
				else
					System.out.println("D");
			else
				System.out.println("F");
		}

	}
}