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

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> scoreArrays = new ArrayList<String>();
		while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		}
		for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		}
	}

} 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 class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> scoreArrays = new ArrayList<String>();
		while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		}
		for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		}
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> scoreArrays = new ArrayList<String>();
		while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		}
		for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> scoreArrays = new ArrayList<String>();
		while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		}
		for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) ArrayList<String> scoreArrays = new ArrayList<String>(); scoreArrays new ArrayList<String>() while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		} true {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		} String strTensu = br.readLine(); strTensu br.readLine() br.readLine br if ("-1 -1 -1".equals(strTensu)) {
				break;
			} "-1 -1 -1".equals(strTensu) "-1 -1 -1".equals "-1 -1 -1" strTensu {
				break;
			} break; String[] strTensuArrays = strTensu.split(" "); strTensuArrays strTensu.split(" ") strTensu.split strTensu " " Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]); totalScore Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]) Integer.parseInt(strTensuArrays[0]) Integer.parseInt Integer strTensuArrays[0] strTensuArrays 0 Integer.parseInt(strTensuArrays[1]) Integer.parseInt Integer strTensuArrays[1] strTensuArrays 1 if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			} !"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1]) !"-1".equals(strTensuArrays[0]) "-1".equals(strTensuArrays[0]) "-1".equals "-1" strTensuArrays[0] strTensuArrays 0 !"-1".equals(strTensuArrays[1]) "-1".equals(strTensuArrays[1]) "-1".equals "-1" strTensuArrays[1] strTensuArrays 1 {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 80 <= totalScore 80 totalScore {
					scoreArrays.add("A");
				} scoreArrays.add("A") scoreArrays.add scoreArrays "A" if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} totalScore < 80 && 65 <= totalScore totalScore < 80 totalScore 80 65 <= totalScore 65 totalScore {
					scoreArrays.add("B");
				} scoreArrays.add("B") scoreArrays.add scoreArrays "B" if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} totalScore < 65 && 50 <= totalScore totalScore < 65 totalScore 65 50 <= totalScore 50 totalScore {
					scoreArrays.add("C");
				} scoreArrays.add("C") scoreArrays.add scoreArrays "C" if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} totalScore < 50 && 30 <= totalScore totalScore < 50 totalScore 50 30 <= totalScore 30 totalScore {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					} 50 <= Integer.parseInt(strTensuArrays[2]) 50 Integer.parseInt(strTensuArrays[2]) Integer.parseInt Integer strTensuArrays[2] strTensuArrays 2 {
						scoreArrays.add("C");
					} scoreArrays.add("C") scoreArrays.add scoreArrays "C" {
						scoreArrays.add("D");
					} scoreArrays.add("D") scoreArrays.add scoreArrays "D" {
					scoreArrays.add("F");
				} scoreArrays.add("F") scoreArrays.add scoreArrays "F" {
				scoreArrays.add("F");
			} scoreArrays.add("F") scoreArrays.add scoreArrays "F" for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		} int i = 0; int i = 0; i 0 i < scoreArrays.size() i scoreArrays.size() scoreArrays.size scoreArrays i++ i++ i {
			System.out.println(scoreArrays.get(i));
		} {
			System.out.println(scoreArrays.get(i));
		} System.out.println(scoreArrays.get(i)) System.out.println System.out System System.out scoreArrays.get(i) scoreArrays.get scoreArrays i String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> scoreArrays = new ArrayList<String>();
		while (true) {
			String strTensu = br.readLine();
			if ("-1 -1 -1".equals(strTensu)) {
				break;
			}
			String[] strTensuArrays = strTensu.split(" ");
			Integer totalScore = Integer.parseInt(strTensuArrays[0]) + Integer.parseInt(strTensuArrays[1]);
			if (!"-1".equals(strTensuArrays[0]) && !"-1".equals(strTensuArrays[1])) {
				if (80 <= totalScore) {
					scoreArrays.add("A");
				} else if (totalScore < 80 && 65 <= totalScore ) {
					scoreArrays.add("B");
				} else if (totalScore < 65 && 50 <= totalScore ) {
					scoreArrays.add("C");
				} else if (totalScore < 50 && 30 <= totalScore ) {
					if (50 <= Integer.parseInt(strTensuArrays[2])) {
						scoreArrays.add("C");
					} else {
						scoreArrays.add("D");
					}
				} else {
					scoreArrays.add("F");
				} 
			} else {
				scoreArrays.add("F");
			}
		}
		for (int i = 0; i < scoreArrays.size(); i++) {
			System.out.println(scoreArrays.get(i));
		}
	}

}