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

class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int m = 0, f = 0, r = 0;

		int sum = 0;
		m = scane.nextInt();
		f = scane.nextInt();
		r = scane.nextInt();


		while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		}



	}
} 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 scane = new Scanner(System.in);

		int m = 0, f = 0, r = 0;

		int sum = 0;
		m = scane.nextInt();
		f = scane.nextInt();
		r = scane.nextInt();


		while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		}



	}
} Main public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int m = 0, f = 0, r = 0;

		int sum = 0;
		m = scane.nextInt();
		f = scane.nextInt();
		r = scane.nextInt();


		while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		}



	} main {

		Scanner scane = new Scanner(System.in);

		int m = 0, f = 0, r = 0;

		int sum = 0;
		m = scane.nextInt();
		f = scane.nextInt();
		r = scane.nextInt();


		while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		}



	} Scanner scane = new Scanner(System.in); scane new Scanner(System.in) int m = 0 m 0 f = 0 f 0 r = 0; r 0 int sum = 0; sum 0 m = scane.nextInt() m scane.nextInt() scane.nextInt scane f = scane.nextInt() f scane.nextInt() scane.nextInt scane r = scane.nextInt() r scane.nextInt() scane.nextInt scane while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		} (m + f + r) != -3 (m + f + r) m + f + r m f r -3 3 {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		} sum = m + f sum m + f m f if (m == -1 || f == -1){
				System.out.println("F");
			} m == -1 || f == -1 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 ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			} (m != -1 && f != -1) &&sum >= 80 (m != -1 && f != -1) m != -1 m -1 1 f != -1 f -1 1 sum >= 80 sum 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			} (m != -1 && f != -1) &&sum < 80 && sum >= 65 (m != -1 && f != -1) &&sum < 80 && sum >= 65 (m != -1 && f != -1) m != -1 m -1 1 f != -1 f -1 1 sum < 80 sum 80 sum >= 65 sum 65 {
				System.out.println("B");

			} System.out.println("B") System.out.println System.out System System.out "B" if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			} (m != -1 && f != -1) &&sum < 65 && sum >= 50 (m != -1 && f != -1) &&sum < 65 && sum >= 50 (m != -1 && f != -1) m != -1 m -1 1 f != -1 f -1 1 sum < 65 sum 65 sum >= 50 sum 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			} (m != -1 && f != -1) &&sum < 50 && sum >= 30 (m != -1 && f != -1) &&sum < 50 && sum >= 30 (m != -1 && f != -1) m != -1 m -1 1 f != -1 f -1 1 sum < 50 sum 50 sum >= 30 sum 30 {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			} if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				} r >= 50 r 50 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" {
					System.out.println("D");
				} 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("F") System.out.println System.out System System.out "F" m = scane.nextInt() m scane.nextInt() scane.nextInt scane f = scane.nextInt() f scane.nextInt() scane.nextInt scane r = scane.nextInt() r scane.nextInt() scane.nextInt scane String[] args args
import java.io.IOException;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int m = 0, f = 0, r = 0;

		int sum = 0;
		m = scane.nextInt();
		f = scane.nextInt();
		r = scane.nextInt();


		while ((m + f + r) != -3) {

			sum = m + f;

			if (m == -1 || f == -1){
				System.out.println("F");
			}

			if ((m != -1 && f != -1) &&sum >= 80) {
				System.out.println("A");
			} else if ((m != -1 && f != -1) &&sum < 80 && sum >= 65) {
				System.out.println("B");

			} else if ((m != -1 && f != -1) &&sum < 65 && sum >= 50) {
				System.out.println("C");
			} else if ((m != -1 && f != -1) &&sum < 50 && sum >= 30) {
				if (r >= 50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}

			}else if (sum <30) {
				System.out.println("F");
			}

			m = scane.nextInt();
			f = scane.nextInt();
			r = scane.nextInt();

		}



	}
}