import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	} main {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		} true {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		} String input_line = input.readLine(); input_line input.readLine() input.readLine input String[] All_test_score = input_line.split(" "); All_test_score input_line.split(" ") input_line.split input_line " " int interm_test_m = Integer.parseInt(All_test_score[0]); interm_test_m Integer.parseInt(All_test_score[0]) Integer.parseInt Integer All_test_score[0] All_test_score 0 int end_test_f = Integer.parseInt(All_test_score[1]); end_test_f Integer.parseInt(All_test_score[1]) Integer.parseInt Integer All_test_score[1] All_test_score 1 int return_test_r = Integer.parseInt(All_test_score[2]); return_test_r Integer.parseInt(All_test_score[2]) Integer.parseInt Integer All_test_score[2] All_test_score 2 if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			} interm_test_m == -1 && end_test_f == -1 && return_test_r == -1 interm_test_m == -1 && end_test_f == -1 && return_test_r == -1 interm_test_m == -1 interm_test_m -1 1 end_test_f == -1 end_test_f -1 1 return_test_r == -1 return_test_r -1 1 {
				break;
			} break; int total_m_f = interm_test_m + end_test_f; total_m_f interm_test_m + end_test_f interm_test_m end_test_f if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			} end_test_f==-1 || interm_test_m==-1||total_m_f<30 end_test_f==-1 || interm_test_m==-1||total_m_f<30 end_test_f==-1 end_test_f -1 1 interm_test_m==-1 interm_test_m -1 1 total_m_f<30 total_m_f 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			} total_m_f >= 80 total_m_f 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			} total_m_f >= 65 && total_m_f < 80 total_m_f >= 65 total_m_f 65 total_m_f < 80 total_m_f 80 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			} total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50 total_m_f >= 50 && total_m_f < 65 total_m_f >= 50 total_m_f 50 total_m_f < 65 total_m_f 65 return_test_r >= 50 return_test_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" String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		// 3?????????????????°??\???
		while (true) {
			String input_line = input.readLine();
			String[] All_test_score = input_line.split(" ");
			// ??????????????????
			int interm_test_m = Integer.parseInt(All_test_score[0]);
			// ??????????????????
			int end_test_f = Integer.parseInt(All_test_score[1]);
			// ???????????????
			int return_test_r = Integer.parseInt(All_test_score[2]);
			// ???????????????????????????????¨?
			if (interm_test_m == -1 && end_test_f == -1 && return_test_r == -1) {
				break;
			}
			int total_m_f = interm_test_m + end_test_f;

			if (end_test_f==-1 || interm_test_m==-1||total_m_f<30 ) {
				System.out.println("F");
			} else if (total_m_f >= 80) {
				System.out.println("A");
			} else if (total_m_f >= 65 && total_m_f < 80) {
				System.out.println("B");
			} else if (total_m_f >= 50 && total_m_f < 65 || return_test_r >= 50) {
				System.out.println("C");
			} else  {
				System.out.println("D");
			}
		}

	}
}