import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	} main {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	} List<Integer> midTermExam = new ArrayList<Integer>(); midTermExam new ArrayList<Integer>() List<Integer> finalTermExam = new ArrayList<Integer>(); finalTermExam new ArrayList<Integer>() List<Integer> reTest = new ArrayList<Integer>(); reTest new ArrayList<Integer>() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		} true {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		} String[] examInfo = br.readLine().split(" "); examInfo br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int midScore = Integer.parseInt(examInfo[0]); midScore Integer.parseInt(examInfo[0]) Integer.parseInt Integer examInfo[0] examInfo 0 int finalScore = Integer.parseInt(examInfo[1]); finalScore Integer.parseInt(examInfo[1]) Integer.parseInt Integer examInfo[1] examInfo 1 int reScore = Integer.parseInt(examInfo[2]); reScore Integer.parseInt(examInfo[2]) Integer.parseInt Integer examInfo[2] examInfo 2 if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			} midScore == -1 && finalScore == -1 && reScore == -1 midScore == -1 && finalScore == -1 && reScore == -1 midScore == -1 midScore -1 1 finalScore == -1 finalScore -1 1 reScore == -1 reScore -1 1 {
				break;
			} break; midTermExam.add(midScore) midTermExam.add midTermExam midScore finalTermExam.add(finalScore) finalTermExam.add finalTermExam finalScore reTest.add(reScore) reTest.add reTest reScore int listSize = midTermExam.size(); listSize midTermExam.size() midTermExam.size midTermExam for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		} int i = 0; int i = 0; i 0 i < listSize i listSize i++ i++ i {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		} {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		} int midScore = midTermExam.get(i); midScore midTermExam.get(i) midTermExam.get midTermExam i int finalScore = finalTermExam.get(i); finalScore finalTermExam.get(i) finalTermExam.get finalTermExam i int reScore = reTest.get(i); reScore reTest.get(i) reTest.get reTest i if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			} midScore == -1 || finalScore == -1 midScore == -1 midScore -1 1 finalScore == -1 finalScore -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			} (midScore + finalScore) >= 80 (midScore + finalScore) midScore finalScore 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			} (midScore + finalScore) >= 65 (midScore + finalScore) midScore finalScore 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			} (midScore + finalScore) >= 50 (midScore + finalScore) midScore finalScore 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			} (midScore + finalScore) >= 30 (midScore + finalScore) midScore finalScore 30 {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				} reScore >= 50 reScore 50 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" {
					System.out.println("D");
				} System.out.println("D") System.out.println System.out System System.out "D" {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {

	public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	}
} public class Main {

	public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {

		List<Integer> midTermExam = new ArrayList<Integer>();
		List<Integer> finalTermExam = new ArrayList<Integer>();
		List<Integer> reTest = new ArrayList<Integer>();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
 			String[] examInfo = br.readLine().split(" ");
 			int midScore = Integer.parseInt(examInfo[0]);
 			int finalScore = Integer.parseInt(examInfo[1]);
 			int reScore = Integer.parseInt(examInfo[2]);

			if (midScore == -1 && finalScore == -1 && reScore == -1) {
				break;
			}
			midTermExam.add(midScore);
			finalTermExam.add(finalScore);
			reTest.add(reScore);
 		}

		int listSize = midTermExam.size();
		for (int i = 0; i < listSize; i++) {
			int midScore = midTermExam.get(i);
			int finalScore = finalTermExam.get(i);
			int reScore = reTest.get(i);

			if (midScore == -1 || finalScore == -1) {
				System.out.println("F");
			} else if ((midScore + finalScore) >= 80) {
				System.out.println("A");
			} else if ((midScore + finalScore) >= 65) {
				System.out.println("B");
			} else if ((midScore + finalScore) >= 50) {
				System.out.println("C");
			} else if ((midScore + finalScore) >= 30) {
				if (reScore >= 50) {
					System.out.println("C");
				} else {
					System.out.println("D");
				}
			} else {
				System.out.println("F");
			}
		}
	}
}