import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		} true {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		} String[] strbfr = br.readLine().split(" "); strbfr br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int m = Integer.parseInt(strbfr[0]); m Integer.parseInt(strbfr[0]) Integer.parseInt Integer strbfr[0] strbfr 0 int f = Integer.parseInt(strbfr[1]); f Integer.parseInt(strbfr[1]) Integer.parseInt Integer strbfr[1] strbfr 1 int r = Integer.parseInt(strbfr[2]); r Integer.parseInt(strbfr[2]) Integer.parseInt Integer strbfr[2] strbfr 2 if (m < 0 & f < 0 & r < 0) { break; } m < 0 & f < 0 & r < 0 m < 0 & f < 0 & r < 0 m < 0 m 0 f < 0 f 0 r < 0 r 0 { break; } break; int sum = m + f; sum m + f m f String score = null; score null if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			} m < 0 | f < 0 m < 0 m 0 f < 0 f 0 {
				score = "F";
			} score = "F" score "F" {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			} if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				} sum >= 80 sum 80 {
					score = "A";
				} score = "A" score "A" if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				} sum >= 65 & sum < 80 sum >= 65 sum 65 sum < 80 sum 80 {
					score = "B";
				} score = "B" score "B" if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				} sum >= 50 & sum < 65 sum >= 50 sum 50 sum < 65 sum 65 {
					score = "C";
				} score = "C" score "C" if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				} sum >= 30 & sum < 50 sum >= 30 sum 30 sum < 50 sum 50 {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					} r >= 50 r 50 {
						score = "C";
					} score = "C" score "C" {
						score = "D";
					} score = "D" score "D" {
					score = "F";
				} score = "F" score "F" System.out.println(score) System.out.println System.out System System.out score String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strbfr = br.readLine().split(" ");
			int m = Integer.parseInt(strbfr[0]);
			int f = Integer.parseInt(strbfr[1]);
			int r = Integer.parseInt(strbfr[2]);
			if (m < 0 & f < 0 & r < 0) { break; }

			int sum = m + f;
			String score = null;
			if (m < 0 | f < 0) {
				score = "F";
			} else {
				if (sum >= 80) {
					score = "A";
				} else if (sum >= 65 & sum < 80) {
					score = "B";
				} else if (sum >= 50 & sum < 65) {
					score = "C";
				} else if (sum >= 30 & sum < 50) {
					if (r >= 50) {
						score = "C";
					} else {
						score = "D";
					}
				} else {
					score = "F";
				}
			}
			System.out.println(score);
		}
	}
}