//??°????????????????±???????????????°??????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) throws IOException{
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	}

} Main public static void main(String[] args) throws IOException{
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	} main {
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	} BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) boolean flg = true; flg true int[] score = new int[3]; score new int[3] 3 String grade = ""; grade "" while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		} flg {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " score[0] = Integer.parseInt(str[0]) score[0] score 0 Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 score[1] = Integer.parseInt(str[1]) score[1] score 1 Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 score[2] = Integer.parseInt(str[2]) score[2] score 2 Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			} score[0]==-1 && score[1]==-1 && score[2]==-1 score[0]==-1 && score[1]==-1 && score[2]==-1 score[0]==-1 score[0] score 0 -1 1 score[1]==-1 score[1] score 1 -1 1 score[2]==-1 score[2] score 2 -1 1 {
				break;
			} break; if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			} score[0] == -1 || score[1] == -1 score[0] == -1 score[0] score 0 -1 1 score[1] == -1 score[1] score 1 -1 1 {
				grade = grade + "F" + "\n";
			} grade = grade + "F" + "\n" grade grade + "F" + "\n" grade + "F" + "\n" grade "F" "\n" if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			} 80 <= score[0]+score[1] 80 score[0]+score[1] score[0] score 0 score[1] score 1 {
				grade = grade + "A" + "\n";
			} grade = grade + "A" + "\n" grade grade + "A" + "\n" grade + "A" + "\n" grade "A" "\n" if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			} score[0]+score[1] < 80 && 65 <=score[0]+score[1] score[0]+score[1] < 80 score[0]+score[1] score[0] score 0 score[1] score 1 80 65 <=score[0]+score[1] 65 score[0]+score[1] score[0] score 0 score[1] score 1 {
				grade = grade + "B" + "\n";
			} grade = grade + "B" + "\n" grade grade + "B" + "\n" grade + "B" + "\n" grade "B" "\n" if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			} score[0]+score[1] < 65 && 50 <=score[0]+score[1] score[0]+score[1] < 65 score[0]+score[1] score[0] score 0 score[1] score 1 65 50 <=score[0]+score[1] 50 score[0]+score[1] score[0] score 0 score[1] score 1 {
				grade = grade + "C" + "\n";
			} grade = grade + "C" + "\n" grade grade + "C" + "\n" grade + "C" + "\n" grade "C" "\n" if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			} score[0]+score[1] < 50 && 30 <=score[0]+score[1] score[0]+score[1] < 50 score[0]+score[1] score[0] score 0 score[1] score 1 50 30 <=score[0]+score[1] 30 score[0]+score[1] score[0] score 0 score[1] score 1 {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			} if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n"; 50 <= score[2] 50 score[2] score 2 {
					grade = grade + "C" + "\n";
				} grade = grade + "C" + "\n" grade grade + "C" + "\n" grade + "C" + "\n" grade "C" "\n" grade = grade + "D" + "\n" grade grade + "D" + "\n" grade + "D" + "\n" grade "D" "\n" {
				grade = grade + "F" + "\n";
			} grade = grade + "F" + "\n" grade grade + "F" + "\n" grade + "F" + "\n" grade "F" "\n" System.out.print(grade) System.out.print System.out System System.out grade String[] args args
//??°????????????????±???????????????°??????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		
		//??°????????????????????????????????°
		boolean flg = true;
		
		//????????????
		int[] score = new int[3];						//????????°???????´?????????????score
		String grade = "";
		
		while(flg) {
			String[] str = br.readLine().split(" ");	//???????????????????????§??????str???????´?
			
			score[0] = Integer.parseInt(str[0]);
			score[1] = Integer.parseInt(str[1]);
			score[2] = Integer.parseInt(str[2]);
			
			if(score[0]==-1 && score[1]==-1 && score[2]==-1) {
				break;
			}
			
			if(score[0] == -1 || score[1] == -1) {
				grade = grade + "F" + "\n";
			}
			else if(80 <= score[0]+score[1]) {
				grade = grade + "A" + "\n";
			}
			else if(score[0]+score[1] < 80 && 65 <=score[0]+score[1]) {
				grade = grade + "B" + "\n";
			}
			else if(score[0]+score[1] < 65 && 50 <=score[0]+score[1]) {
				grade = grade + "C" + "\n";
			}
			else if(score[0]+score[1] < 50 && 30 <=score[0]+score[1]) {
				if(50 <= score[2]) {
					grade = grade + "C" + "\n";
				}
				else
					grade = grade + "D" + "\n";
			}
			else {
				grade = grade + "F" + "\n";
			}
			
		}
		System.out.print(grade);
	}

}