import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  	m,
				f,
				r,
				num=0;
		
		String[] input = new String[3];
		String[] grade = new String[50];
		
		try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		//出力
		for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		}
		
	}
}
 import java.io.*; io.* java import java.io.IOException; IOException java.io class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  	m,
				f,
				r,
				num=0;
		
		String[] input = new String[3];
		String[] grade = new String[50];
		
		try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		//出力
		for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		}
		
	}
} Main public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  	m,
				f,
				r,
				num=0;
		
		String[] input = new String[3];
		String[] grade = new String[50];
		
		try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		//出力
		for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		}
		
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  	m,
				f,
				r,
				num=0;
		
		String[] input = new String[3];
		String[] grade = new String[50];
		
		try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		//出力
		for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		}
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int  	m m f f r r num=0; num 0 String[] input = new String[3]; input new String[3] 3 String[] grade = new String[50]; grade new String[50] 50 try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		} catch(IOException e){
			System.out.println(e);
			return;
		} IOException e {
			System.out.println(e);
			return;
		} System.out.println(e) System.out.println System.out System System.out e return; {
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		} input = br.readLine().split("[\\s]+") input br.readLine().split("[\\s]+") br.readLine().split br.readLine() br.readLine br "[\\s]+" while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			} true {
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			} m = Integer.parseInt(input[0]) m Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 f = Integer.parseInt(input[1]) f Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 r = Integer.parseInt(input[2]) r Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 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 < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				} m < 0 || f < 0 || m + f < 30 m < 0 || f < 0 || m + f < 30 m < 0 m 0 f < 0 f 0 m + f < 30 m + f m f 30 {
					grade[num] = "F";
				} grade[num] = "F" grade[num] grade num "F" if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				} m + f < 50 && r < 50 m + f < 50 m + f m f 50 r < 50 r 50 {
					grade[num] = "D";
				} grade[num] = "D" grade[num] grade num "D" if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				} m + f < 65 m + f m f 65 {
					grade[num] = "C";
				} grade[num] = "C" grade[num] grade num "C" if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				} m + f < 80 m + f m f 80 {
					grade[num] = "B";
				} grade[num] = "B" grade[num] grade num "B" {
					grade[num] = "A";
				} grade[num] = "A" grade[num] grade num "A" num++ num input = br.readLine().split("[\\s]+") input br.readLine().split("[\\s]+") br.readLine().split br.readLine() br.readLine br "[\\s]+" for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			System.out.println(grade[i]);
		} {
			System.out.println(grade[i]);
		} System.out.println(grade[i]) System.out.println System.out System System.out grade[i] grade i String args[] args
import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  	m,
				f,
				r,
				num=0;
		
		String[] input = new String[3];
		String[] grade = new String[50];
		
		try{
			input = br.readLine().split("[\\s]+");
			
			while(true){
				m = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				
				//終了判定
				if(m == -1 && f == -1 && r == -1){
					break;
				}
				
				//成績判定
				if(m < 0 || f < 0 || m + f < 30){
					grade[num] = "F";
				}else if(m + f < 50 && r < 50){
					grade[num] = "D";
				}else if(m + f < 65){
					grade[num] = "C";
				}else if(m + f < 80){
					grade[num] = "B";
				}else{
					grade[num] = "A";
				}
				num++;
				input = br.readLine().split("[\\s]+");
			}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		//出力
		for(int i=0;i<num;i++){
			System.out.println(grade[i]);
		}
		
	}
}

