import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	}
	
	private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	}
	
	private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		} true {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		} int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc 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; System.out.println(grade(m, f, r)) System.out.println System.out System System.out grade(m, f, r) grade m f r sc.close() sc.close sc String[] args args private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	} grade {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	} int mf = m + f; mf m + f m f if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		} m == -1 || f == -1 || mf < 30 m == -1 || f == -1 || mf < 30 m == -1 m -1 1 f == -1 f -1 1 mf < 30 mf 30 {
			return 'F';
		} return 'F'; 'F' if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		} 30 <= mf && mf < 50 30 <= mf 30 mf mf < 50 mf 50 {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} if (r >= 50) {
				return 'C';
			} r >= 50 r 50 {
				return 'C';
			} return 'C'; 'C' return 'D'; 'D' if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		} 50 <= mf && mf < 65 50 <= mf 50 mf mf < 65 mf 65 {
			return 'C';
		} return 'C'; 'C' if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		} 65 <= mf && mf < 80 65 <= mf 65 mf mf < 80 mf 80 {
			return 'B';
		} return 'B'; 'B' {
			return 'A';
		} return 'A'; 'A' int m m int f f int r r public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	}
	
	private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	}
	
	private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if (m == -1 && f == -1 && r == -1) break;
			System.out.println(grade(m, f, r));
		}
		sc.close();
	}
	
	private static char grade(int m, int f, int r) {
		int mf = m + f;
		if (m == -1 || f == -1 || mf < 30) {
			return 'F';
		} else if (30 <= mf && mf < 50) {
			if (r >= 50) {
				return 'C';
			}
			return 'D';
		} else if (50 <= mf && mf < 65) {
			return 'C';
		} else if (65 <= mf && mf < 80) {
			return 'B';
		} else {
			return 'A';
		}
	}
}