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));
		}
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz