import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		
		while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		
		while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		}
	}
} Main public static void main(String[] args) throws IOException {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		
		while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		}
	} main {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		
		while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		}
	} InputStreamReader in = new InputStreamReader(System.in); in new InputStreamReader(System.in) BufferedReader br = new BufferedReader(in); br new BufferedReader(in) while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		} true {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		} String[] buf = (br.readLine()).split(" "); buf (br.readLine()).split(" ") (br.readLine()).split (br.readLine()) br.readLine br " " int mid_exam = Integer.parseInt(buf[0]); mid_exam Integer.parseInt(buf[0]) Integer.parseInt Integer buf[0] buf 0 int final_exam = Integer.parseInt(buf[1]); final_exam Integer.parseInt(buf[1]) Integer.parseInt Integer buf[1] buf 1 int retest = Integer.parseInt(buf[2]); retest Integer.parseInt(buf[2]) Integer.parseInt Integer buf[2] buf 2 char result; result if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			} mid_exam == -1 && final_exam == -1 && retest == -1 mid_exam == -1 && final_exam == -1 && retest == -1 mid_exam == -1 mid_exam -1 1 final_exam == -1 final_exam -1 1 retest == -1 retest -1 1 {
				break;
			} break; if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			} mid_exam == -1 || final_exam == -1 mid_exam == -1 mid_exam -1 1 final_exam == -1 final_exam -1 1 {
				result = 'F';
			} result = 'F' result 'F' {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			} if (mid_exam == -1) { mid_exam = 0; } mid_exam == -1 mid_exam -1 1 { mid_exam = 0; } mid_exam = 0 mid_exam 0 if (final_exam == -1 ) { final_exam = 0; } final_exam == -1 final_exam -1 1 { final_exam = 0; } final_exam = 0 final_exam 0 int sum = mid_exam + final_exam; sum mid_exam + final_exam mid_exam final_exam if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; } sum >= 80 sum 80 { result = 'A'; } result = 'A' result 'A' if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; } sum >= 65 sum 65 { result = 'B'; } result = 'B' result 'B' if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; } sum >= 50 sum 50 { result = 'C'; } result = 'C' result 'C' if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; } sum >= 30 sum 30 {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } } if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } retest >= 50 retest 50 { result = 'C'; } result = 'C' result 'C' { result = 'D'; } result = 'D' result 'D' { result = 'F'; } result = 'F' result 'F' System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		
		while (true) {
			String[] buf = (br.readLine()).split(" ");
			int mid_exam = Integer.parseInt(buf[0]);
			int final_exam = Integer.parseInt(buf[1]);
			int retest = Integer.parseInt(buf[2]);
			char result;
			
			if (mid_exam == -1 && final_exam == -1 && retest == -1) {
				break;
			}
			
			if (mid_exam == -1 || final_exam == -1) {
				result = 'F';
			} else {
			
				if (mid_exam == -1) { mid_exam = 0; }
				if (final_exam == -1 ) { final_exam = 0; }
				int sum = mid_exam + final_exam;
				
				if (sum >= 80) { result = 'A'; }
				else if (sum >= 65) { result = 'B'; }
				else if (sum >= 50) { result = 'C'; }
				else if (sum >= 30) {
					if (retest >= 50) { result = 'C'; }
					else { result = 'D'; } }
				else { result = 'F'; }
			}
			
			System.out.println(result);
		}
	}
}