import java.io.*;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = new String[3];
		int in[] = new int[3];
		while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
} import java.io.*; io.* java class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = new String[3];
		int in[] = new int[3];
		while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
} Main public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = new String[3];
		int in[] = new int[3];
		while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = new String[3];
		int in[] = new int[3];
		while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = new String[3]; str new String[3] 3 int in[] = new int[3]; in new int[3] 3 while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		} true {
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		} str = br.readLine().split(" ") str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " in = parseInts(str) in parseInts(str) parseInts str if(in[0]==-1 && in[1]==-1 && in[2]==-1) break; in[0]==-1 && in[1]==-1 && in[2]==-1 in[0]==-1 && in[1]==-1 && in[2]==-1 in[0]==-1 in[0] in 0 -1 1 in[1]==-1 in[1] in 1 -1 1 in[2]==-1 in[2] in 2 -1 1 break; if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			} in[0]==-1 || in[1]==-1 in[0]==-1 in[0] in 0 -1 1 in[1]==-1 in[1] in 1 -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			} in[0]+in[1]>=80 in[0]+in[1] in[0] in 0 in[1] in 1 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			} in[0]+in[1]>=65 in[0]+in[1] in[0] in 0 in[1] in 1 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			} in[0]+in[1]>=50 in[0]+in[1] in[0] in 0 in[1] in 1 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			} in[0]+in[1]>=30 in[0]+in[1] in[0] in 0 in[1] in 1 30 {
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			} if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				} in[2]>=50 in[2] in 2 50 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" {
					System.out.println("D");
				} System.out.println("D") System.out.println System.out System System.out "D" {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" String[] args args static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	} parseInts {
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	} int[] x = new int[s.length]; x new int[s.length] s.length s s.length for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		} int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
			x[i] = Integer.parseInt(s[i]);
		} {
			x[i] = Integer.parseInt(s[i]);
		} x[i] = Integer.parseInt(s[i]) x[i] x i Integer.parseInt(s[i]) Integer.parseInt Integer s[i] s i return x; x String[] s s
import java.io.*;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = new String[3];
		int in[] = new int[3];
		while(true){
			str = br.readLine().split(" ");
			in = parseInts(str);
			if(in[0]==-1 && in[1]==-1 && in[2]==-1) break;
			if(in[0]==-1 || in[1]==-1){
				System.out.println("F");
			}else if(in[0]+in[1]>=80){
				System.out.println("A");
			}else if(in[0]+in[1]>=65){
				System.out.println("B");
			}else if(in[0]+in[1]>=50){
				System.out.println("C");
			}else if(in[0]+in[1]>=30){
				if(in[2]>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}
	}
	static int[] parseInts(String[] s){
		int[] x = new int[s.length];
		for(int i=0; i<s.length; i++){
			x[i] = Integer.parseInt(s[i]);
		}
		return x;
	}
}