import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str;
		int m,f,r;

		while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		}
		System.out.print(sb);		
	}
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str;
		int m,f,r;

		while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		}
		System.out.print(sb);		
	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str;
		int m,f,r;

		while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		}
		System.out.print(sb);		
	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str;
		int m,f,r;

		while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		}
		System.out.print(sb);		
	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] str; str int m m f f r; r while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		} true {
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		} str = buf.readLine().split(" ") str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " m = Integer.parseInt(str[0]) m Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 f = Integer.parseInt(str[1]) f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 r = Integer.parseInt(str[2]) r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 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; if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			} 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 sb.append("F"+"\n") sb.append sb "F"+"\n" "F" "\n" {
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			} if(m+f >= 80)
					sb.append("A" + "\n"); m+f >= 80 m+f m f 80 sb.append("A" + "\n") sb.append sb "A" + "\n" "A" "\n" if(m+f>=65 && m+f <80)
					sb.append("B" + "\n"); m+f>=65 && m+f <80 m+f>=65 m+f m f 65 m+f <80 m+f m f 80 sb.append("B" + "\n") sb.append sb "B" + "\n" "B" "\n" if(m+f>=50 && m+f<65)
					sb.append("C" + "\n"); m+f>=50 && m+f<65 m+f>=50 m+f m f 50 m+f<65 m+f m f 65 sb.append("C" + "\n") sb.append sb "C" + "\n" "C" "\n" if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				} m+f>=30 && m+f<50 m+f>=30 m+f m f 30 m+f<50 m+f m f 50 {
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				} if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n"); r >= 50 r 50 sb.append("C" + "\n") sb.append sb "C" + "\n" "C" "\n" sb.append("D"+"\n") sb.append sb "D"+"\n" "D" "\n" System.out.print(sb) System.out.print System.out System System.out sb String args[] args
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] str;
		int m,f,r;

		while(true){
			str = buf.readLine().split(" ");
			m = Integer.parseInt(str[0]);
			f = Integer.parseInt(str[1]);
			r = Integer.parseInt(str[2]);
			if(m==-1 && f==-1 && r==-1)
				break;
			if(m == -1 || f == -1 || (m+f)<30)
				sb.append("F"+"\n");
			else{
				if(m+f >= 80)
					sb.append("A" + "\n");
				if(m+f>=65 && m+f <80)
					sb.append("B" + "\n");
				if(m+f>=50 && m+f<65)
					sb.append("C" + "\n");
				if(m+f>=30 && m+f<50){
					if(r >= 50)
						sb.append("C" + "\n");
					else 
						sb.append("D"+"\n");
				}
			}

		}
		System.out.print(sb);		
	}
}