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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	}
} import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		} true {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		} String[] strAry = br.readLine().split(" "); strAry br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int m = Integer.parseInt(strAry[0]); m Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 int f = Integer.parseInt(strAry[1]); f Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 int r = Integer.parseInt(strAry[2]); r Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 2 if (m == -1 && f == -1 && r == -1) {
				break;
			} 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) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} m == -1 || f == -1 || m + f < 30 m == -1 || f == -1 || m + f < 30 m == -1 m -1 1 f == -1 f -1 1 m + f < 30 m + f m f 30 System.out.println("F") System.out.println System.out System System.out "F" if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} 80 <= m + f 80 m + f m f System.out.println("A") System.out.println System.out System System.out "A" if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} 65 <= m + f && m + f < 80 65 <= m + f 65 m + f m f m + f < 80 m + f m f 80 System.out.println("B") System.out.println System.out System System.out "B" if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} 50 <= m + f && m + f < 65 50 <= m + f 50 m + f m f m + f < 65 m + f m f 65 System.out.println("C") System.out.println System.out System System.out "C" if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} 30 <= m + f && m + f < 50 30 <= m + f 30 m + f m f m + f < 50 m + f m f 50 {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			} if (50 <= r) System.out.println("C");
				else System.out.println("D"); 50 <= r 50 r System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	}
} Main
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] strAry = br.readLine().split(" ");
			int m = Integer.parseInt(strAry[0]);
			int f = Integer.parseInt(strAry[1]);
			int r = Integer.parseInt(strAry[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			}
			if (m == -1 || f == -1 || m + f < 30) System.out.println("F");
			else if (80 <= m + f) System.out.println("A");
			else if (65 <= m + f && m + f < 80) System.out.println("B");
			else if (50 <= m + f && m + f < 65) System.out.println("C"); 
			else if (30 <= m + f && m + f < 50) {
				if (50 <= r) System.out.println("C");
				else System.out.println("D");
			}
		}
	}
}