import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	}
} Main public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	} main {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	} Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) List<String> result = new ArrayList<>(); result new ArrayList<>() while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		} true {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		} int m = stdin.nextInt(); m stdin.nextInt() stdin.nextInt stdin int f = stdin.nextInt(); f stdin.nextInt() stdin.nextInt stdin int r = stdin.nextInt(); r stdin.nextInt() stdin.nextInt stdin 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; int grade = m+f; grade m+f m f if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			} grade < 30 || m == -1 || f == -1 grade < 30 || m == -1 || f == -1 grade < 30 grade 30 m == -1 m -1 1 f == -1 f -1 1 {
				result.add("F");
			} result.add("F") result.add result "F" {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			} if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				} grade >= 80 grade 80 {
					result.add("A");
				} result.add("A") result.add result "A" if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				} grade >= 65 && grade < 80 grade >= 65 grade 65 grade < 80 grade 80 {
					result.add("B");
				} result.add("B") result.add result "B" if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				} grade >= 50 && grade < 65 grade >= 50 grade 50 grade < 65 grade 65 {
					result.add("C");
				} result.add("C") result.add result "C" if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				} grade >= 30 && grade < 50 grade >= 30 grade 30 grade < 50 grade 50 {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				} if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					} r >= 50 r 50 {
						result.add("C");
					} result.add("C") result.add result "C" {
						result.add("D");
					} result.add("D") result.add result "D" for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		} int i = 0; int i = 0; i 0 i < result.size() i result.size() result.size result i++ i++ i {
			System.out.println(result.get(i));
		} {
			System.out.println(result.get(i));
		} System.out.println(result.get(i)) System.out.println System.out System System.out result.get(i) result.get result i String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	}
} public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		List<String> result = new ArrayList<>();
		while (true) {
			int m = stdin.nextInt();
			int f = stdin.nextInt();
			int r = stdin.nextInt();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			int grade = m+f;
			if ( grade < 30 || m == -1 || f == -1 ) {
				result.add("F");
			} else {

				if (grade >= 80) {
					result.add("A");
				} else if (grade >= 65 && grade < 80) {
					result.add("B");
				} else if (grade >= 50 && grade < 65) {
					result.add("C");
				} else if (grade >= 30 && grade < 50) {
					if( r >= 50 ) {
						result.add("C");
					}else {
						result.add("D");
					}				
				}
			}
		}
		for (int i = 0; i < result.size(); i++) {
			System.out.println(result.get(i));
		}

	}
}