import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	}

	private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	}

	private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	}
} Main public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	} main {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	} @SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		} true {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		} int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan if (m == -1 && f == -1 && r == -1)
				break; m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 break; System.out.println(run(m, f, r)) System.out.println System.out System System.out run(m, f, r) run m f r System.exit(0) System.exit System 0 String[] args args private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	} run {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	} if (m == -1 || f == -1)
			return ("F"); m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 return ("F"); ("F") if (m + f >= 80)
			return ("A"); m + f >= 80 m + f m f 80 return ("A"); ("A") if (m + f >= 65)
			return ("B"); m + f >= 65 m + f m f 65 return ("B"); ("B") if (m + f >= 50)
			return ("C"); m + f >= 50 m + f m f 50 return ("C"); ("C") if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D"); m + f >= 30 m + f m f 30 if (r >= 50)
				return ("C");
			else
				return ("D"); r >= 50 r 50 return ("C"); ("C") return ("D"); ("D") return ("F"); ("F") int m m int f f int r r public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	}

	private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	}
} public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	}

	private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);
		while (true) {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if (m == -1 && f == -1 && r == -1)
				break;
			System.out.println(run(m, f, r));
		}
		System.exit(0);
	}

	private static String run(int m, int f, int r) {
		if (m == -1 || f == -1)
			return ("F");
		if (m + f >= 80)
			return ("A");
		if (m + f >= 65)
			return ("B");
		if (m + f >= 50)
			return ("C");
		if (m + f >= 30)
			if (r >= 50)
				return ("C");
			else
				return ("D");
		return ("F");

	}
}