import java.util.Scanner;

public class Main {

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

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	}

	static void judge(int a, int b, int c){
		int sum = a + b;
		if(a == -1 || b == -1) System.out.println("F");
		else if (sum >= 80) System.out.println("A");
		else if (sum >= 65 && sum < 80) System.out.println("B");
		else if (sum >= 50 && sum < 65) System.out.println("C");
		else if (sum >= 30 && sum < 50) {
			if (c >= 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 sc = new Scanner(System.in);

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	}

	static void judge(int a, int b, int c){
		int sum = a + b;
		if(a == -1 || b == -1) System.out.println("F");
		else if (sum >= 80) System.out.println("A");
		else if (sum >= 65 && sum < 80) System.out.println("B");
		else if (sum >= 50 && sum < 65) System.out.println("C");
		else if (sum >= 30 && sum < 50) {
			if (c >= 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 sc = new Scanner(System.in);

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	} main {
		Scanner sc = new Scanner(System.in);

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

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

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	}

	static void judge(int a, int b, int c){
		int sum = a + b;
		if(a == -1 || b == -1) System.out.println("F");
		else if (sum >= 80) System.out.println("A");
		else if (sum >= 65 && sum < 80) System.out.println("B");
		else if (sum >= 50 && sum < 65) System.out.println("C");
		else if (sum >= 30 && sum < 50) {
			if (c >= 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 sc = new Scanner(System.in);

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	}

	static void judge(int a, int b, int c){
		int sum = a + b;
		if(a == -1 || b == -1) System.out.println("F");
		else if (sum >= 80) System.out.println("A");
		else if (sum >= 65 && sum < 80) System.out.println("B");
		else if (sum >= 50 && sum < 65) System.out.println("C");
		else if (sum >= 30 && sum < 50) {
			if (c >= 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 sc = new Scanner(System.in);

		while (true) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (a == -1 && b == -1 && c == -1)
				break;
			judge(a, b, c);
		}
	}

	static void judge(int a, int b, int c){
		int sum = a + b;
		if(a == -1 || b == -1) System.out.println("F");
		else if (sum >= 80) System.out.println("A");
		else if (sum >= 65 && sum < 80) System.out.println("B");
		else if (sum >= 50 && sum < 65) System.out.println("C");
		else if (sum >= 30 && sum < 50) {
			if (c >= 50) System.out.println("C");
			else System.out.println("D");
		} else if (sum < 30) System.out.println("F");
	}
}