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

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.LinkedList; LinkedList java.util import java.util.List; List java.util class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} List<String> ret = new LinkedList<String>(); ret new LinkedList<String>() int m m f f r; r do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true); true {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} String[] inputList = br.readLine().split(" "); inputList br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(inputList[0]) m Integer.parseInt(inputList[0]) Integer.parseInt Integer inputList[0] inputList 0 f = Integer.parseInt(inputList[1]) f Integer.parseInt(inputList[1]) Integer.parseInt Integer inputList[1] inputList 1 r = Integer.parseInt(inputList[2]) r Integer.parseInt(inputList[2]) Integer.parseInt Integer inputList[2] inputList 2 if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				} 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;
				} break; if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				} (m == -1 || f == -1) || m + f < 30 (m == -1 || f == -1) m == -1 m -1 1 f == -1 f -1 1 m + f < 30 m + f m f 30 {
					ret.add("F");
				} ret.add("F") ret.add ret "F" if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				} m + f < 50 && r < 50 m + f < 50 m + f m f 50 r < 50 r 50 {
					ret.add("D");
				} ret.add("D") ret.add ret "D" if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				} (m + f < 50 && r >= 50) || m + f < 65 (m + f < 50 && r >= 50) m + f < 50 m + f m f 50 r >= 50 r 50 m + f < 65 m + f m f 65 {
					ret.add("C");
				} ret.add("C") ret.add ret "C" if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				} m + f < 80 m + f m f 80 {
					ret.add("B");
				} ret.add("B") ret.add ret "B" {
					ret.add("A");
				} ret.add("A") ret.add ret "A" for (String text : ret) {
				System.out.println(text);
			} String text ret {
				System.out.println(text);
			} {
				System.out.println(text);
			} System.out.println(text) System.out.println System.out System System.out text String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			List<String> ret = new LinkedList<String>();
			int m, f, r;
			do {
				String[] inputList = br.readLine().split(" ");
				m = Integer.parseInt(inputList[0]);
				f = Integer.parseInt(inputList[1]);
				r = Integer.parseInt(inputList[2]);
				if (m == -1 && f == -1 && r == -1) {
					break;
				} else if ((m == -1 || f == -1) || m + f < 30) {
					ret.add("F");
				} else if (m + f < 50 && r < 50) {
					ret.add("D");
				} else if ((m + f < 50 && r >= 50) || m + f < 65) {
					ret.add("C");
				} else if (m + f < 80) {
					ret.add("B");
				} else {
					ret.add("A");
				}
			} while (true);
			for (String text : ret) {
				System.out.println(text);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}