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

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} 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) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} Main public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String str = ""; str "" for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			} ; {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			} {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			} String input = reader.readLine(); input reader.readLine() reader.readLine reader String[] array = input.split(" "); array input.split(" ") input.split input " " int m = Integer.parseInt(array[0]); m Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 int f = Integer.parseInt(array[1]); f Integer.parseInt(array[1]) Integer.parseInt Integer array[1] array 1 int r = Integer.parseInt(array[2]); r Integer.parseInt(array[2]) Integer.parseInt Integer array[2] array 2 int sum = m + f; sum m + f m f if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} 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) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
					System.out.print("F");
				} System.out.print("F") System.out.print System.out System System.out "F" if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} sum >= 80 sum 80 {
					System.out.print("A");
				} System.out.print("A") System.out.print System.out System System.out "A" if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 {
					System.out.print("B");
				} System.out.print("B") System.out.print System.out System System.out "B" if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} sum >= 50 && sum < 65 sum >= 50 sum 50 sum < 65 sum 65 {
					System.out.print("C");
				} System.out.print("C") System.out.print System.out System System.out "C" if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				} sum >= 30 && sum < 50 sum >= 30 sum 30 sum < 50 sum 50 {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					} r >= 50 r 50 {
						System.out.print("C");
					} System.out.print("C") System.out.print System.out System System.out "C" {
						System.out.print("D");
					} System.out.print("D") System.out.print System.out System System.out "D" if (sum < 30) {
					System.out.print("F");
				} sum < 30 sum 30 {
					System.out.print("F");
				} System.out.print("F") System.out.print System.out System System.out "F" System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

} public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

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

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String str = "";
			for (;;) {
				String input = reader.readLine();
				String[] array = input.split(" ");
				int m = Integer.parseInt(array[0]);
				int f = Integer.parseInt(array[1]);
				int r = Integer.parseInt(array[2]);
				int sum = m + f;
			
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if (m == -1 || f == -1) {
					System.out.print("F");
				} else if (sum >= 80 ) {
					System.out.print("A");
				} else if (sum >= 65 && sum < 80) {
					System.out.print("B");
				} else if (sum >= 50 && sum < 65) {
					System.out.print("C");
				} else if (sum >= 30 && sum < 50) {
					if (r >= 50) {
						System.out.print("C");
					} else {
						System.out.print("D");
					}
				} else if (sum < 30) {
					System.out.print("F");
				}
				System.out.println();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}