import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	}
	public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	}
	public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		} scanner.hasNext() scanner.hasNext scanner {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		} int m = Integer.parseInt(scanner.next()); m Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int t = Integer.parseInt(scanner.next()); t Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int r = Integer.parseInt(scanner.next()); r Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner if (m == -1 && t == -1 && r == -1) break; m == -1 && t == -1 && r == -1 m == -1 && t == -1 && r == -1 m == -1 m -1 1 t == -1 t -1 1 r == -1 r -1 1 break; System.out.println(Judge(m, t, r)) System.out.println System.out System System.out Judge(m, t, r) Judge m t r scanner.close() scanner.close scanner String[] args args public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	} Judge {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	} if (m == -1 || t == -1) return 'F'; m == -1 || t == -1 m == -1 m -1 1 t == -1 t -1 1 return 'F'; 'F' if (80 <= m + t) return 'A'; 80 <= m + t 80 m + t m t return 'A'; 'A' if (65 <= m + t) return 'B'; 65 <= m + t 65 m + t m t return 'B'; 'B' if (50 <= m + t) return 'C'; 50 <= m + t 50 m + t m t return 'C'; 'C' if (30 <= m + t) return 50 <= r ? 'C': 'D'; 30 <= m + t 30 m + t m t return 50 <= r ? 'C': 'D'; 50 <= r ? 'C': 'D' 50 <= r 50 r 'C' 'D' return 'F'; 'F' int m m int t t int r r public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	}
	public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	}
	public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int m = Integer.parseInt(scanner.next());
			int t = Integer.parseInt(scanner.next());
			int r = Integer.parseInt(scanner.next());
			if (m == -1 && t == -1 && r == -1) break;
			System.out.println(Judge(m, t, r));
		}
		scanner.close();
	}
	public static char Judge(int m, int t, int r) {
		if (m == -1 || t == -1) return 'F';
		if (80 <= m + t) return 'A';
		if (65 <= m + t) return 'B';
		if (50 <= m + t) return 'C';
		if (30 <= m + t) return 50 <= r ? 'C': 'D';
		return 'F';
	}
}