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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	}
} 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 br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String P = ""; P "" while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		} true {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int m = Integer.parseInt(str[0]); m Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int f = Integer.parseInt(str[1]); f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int r = Integer.parseInt(str[2]); r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 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;
			} break; if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				P = "F";
			} P = "F" P "F" if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			} m + f >= 80 m + f m f 80 {
				P = "A";
			} P = "A" P "A" if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			} m + f >= 65 m + f m f 65 {
				P = "B";
			} P = "B" P "B" if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			} m + f >= 50 m + f m f 50 {
				P = "C";
			} P = "C" P "C" if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			} m + f >= 30 m + f m f 30 {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				} r >= 50 r 50 {
					P = "C";
				} P = "C" P "C" {
					P = "D";
				} P = "D" P "D" {
				P = "F";
			} P = "F" P "F" sb.append(P).append("\n") sb.append(P).append sb.append(P) sb.append sb P "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	}
} 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 br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String P = "";

		while (true) {
			String[] str = br.readLine().split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1) {
				P = "F";
			} else if (m + f >= 80) {
				P = "A";
			} else if (m + f >= 65) {
				P = "B";
			} else if (m + f >= 50) {
				P = "C";
			} else if (m + f >= 30) {
				if (r >= 50) {
					P = "C";
				} else {
					P = "D";
				}
			} else {
				P = "F";
			}
			sb.append(P).append("\n");
		}
		System.out.print(sb);
	}
}