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

class Calculator {
	String testCal(int m, int f, int r) {
		int sum = 0;
		String testGrade = null;
		/**
		 * ???????????????
		 */
		sum = m + f;
		if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		}

		return testGrade;
	}

}

public class Main {

	public static void main(String[] args) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.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 Calculator {
	String testCal(int m, int f, int r) {
		int sum = 0;
		String testGrade = null;
		/**
		 * ???????????????
		 */
		sum = m + f;
		if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		}

		return testGrade;
	}

} Calculator String testCal(int m, int f, int r) {
		int sum = 0;
		String testGrade = null;
		/**
		 * ???????????????
		 */
		sum = m + f;
		if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		}

		return testGrade;
	} testCal {
		int sum = 0;
		String testGrade = null;
		/**
		 * ???????????????
		 */
		sum = m + f;
		if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		}

		return testGrade;
	} int sum = 0; sum 0 String testGrade = null; testGrade null sum = m + f sum m + f m f if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} testGrade = "F" testGrade "F" if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} sum >= 80 sum 80 { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} testGrade = "A" testGrade "A" if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} sum >= 65 && m + f < 80 sum >= 65 sum 65 m + f < 80 m + f m f 80 { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} testGrade = "B" testGrade "B" if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} sum >= 50 && m + f < 65 sum >= 50 sum 50 m + f < 65 m + f m f 65 { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} testGrade = "C" testGrade "C" if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} sum >= 30 && m + f < 50 sum >= 30 sum 30 m + f < 50 m + f m f 50 { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D"; r >= 50 r 50 {
				testGrade = "C";
			} testGrade = "C" testGrade "C" testGrade = "D" testGrade "D" if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		} sum < 30 sum 30 { // 30?????\??????F
			testGrade = "F";
		} testGrade = "F" testGrade "F" return testGrade; testGrade int m m int f f int r r public class Main {

	public static void main(String[] args) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	}

} Main public static void main(String[] args) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	} main {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	} Calculator cal = new Calculator(); cal new Calculator() int m = 0 m 0 f = 0 f 0 r = 0; r 0 String str; str String tmpBox[] = new String[3]; tmpBox new String[3] 3 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) ArrayList<String> result = new ArrayList<String>(); result new ArrayList<String>() while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		} true {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		} str = br.readLine() str br.readLine() br.readLine br if (str.equals("-1 -1 -1")) {
				break;
			} str.equals("-1 -1 -1") str.equals str "-1 -1 -1" {
				break;
			} break; tmpBox = str.split(" ", 0) tmpBox str.split(" ", 0) str.split str " " 0 m = Integer.parseInt(tmpBox[0]) m Integer.parseInt(tmpBox[0]) Integer.parseInt Integer tmpBox[0] tmpBox 0 f = Integer.parseInt(tmpBox[1]) f Integer.parseInt(tmpBox[1]) Integer.parseInt Integer tmpBox[1] tmpBox 1 r = Integer.parseInt(tmpBox[2]) r Integer.parseInt(tmpBox[2]) Integer.parseInt Integer tmpBox[2] tmpBox 2 result.add(cal.testCal(m, f, r)) result.add result cal.testCal(m, f, r) cal.testCal cal m f r 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) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	}

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

class Calculator {
	String testCal(int m, int f, int r) {
		int sum = 0;
		String testGrade = null;
		/**
		 * ???????????????
		 */
		sum = m + f;
		if (m == -1 || f == -1) { // ??????or?????????????????????????????????????????¶??§F
			testGrade = "F";
		} else if (sum >= 80) { // ??????+??????????????????80?????\?????????A
			testGrade = "A";
		} else if (sum >= 65 && m + f < 80) { // ??????+??????????????????65?????\???,80???????????????"B"
			testGrade = "B";
		} else if (sum >= 50 && m + f < 65) { // ??????+??????????????????50?????\???,65???????????????"C"
			testGrade = "C";
		} else if (sum >= 30 && m + f < 50) { // ??????+??????????????????30?????\???,50???????????????"D"
												// ?????????????????????50??\?????????"C"
			if (r >= 50) {
				testGrade = "C";
			}
			else
			testGrade = "D";
		} else if (sum < 30) { // 30?????\??????F
			testGrade = "F";
		}

		return testGrade;
	}

}

public class Main {

	public static void main(String[] args) throws IOException {
		Calculator cal = new Calculator();
		int m = 0, f = 0, r = 0; // ????????????????????????
		String str;
		String tmpBox[] = new String[3]; // split?????¨??????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> result = new ArrayList<String>();
		while (true) {
			str = br.readLine();
			if (str.equals("-1 -1 -1")) {
				break;
			}
			tmpBox = str.split(" ", 0);
			m = Integer.parseInt(tmpBox[0]);
			f = Integer.parseInt(tmpBox[1]);
			r = Integer.parseInt(tmpBox[2]);
			result.add(cal.testCal(m, f, r));
		}
		for (int i = 0; i < result.size(); ++i) {
			System.out.println(result.get(i));
		}
	}

}