import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	}
} Main public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	} main {
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	} String[] str; str int m m f f r; r String s; s BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		} true {
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		} str = br.readLine().split(" ") str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " 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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			} m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				s="F";
			} s="F" s "F" if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			} m + f < 30 m + f m f 30 {
				s="F";
			} s="F" s "F" if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			} m + f < 50 m + f m f 50 {
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			} if(r >= 50){
					s="C";
				}else{
					s="D";
				} r >= 50 r 50 {
					s="C";
				} s="C" s "C" {
					s="D";
				} s="D" s "D" if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			} m + f < 65 m + f m f 65 {
				s ="C";
			} s ="C" s "C" if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			} m + f < 80 m + f m f 80 {
				s = "B";
			} s = "B" s "B" {
				s = "A";
			} s = "A" s "A" System.out.println(s) System.out.println System.out System System.out s br.close() br.close br String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		String[] str;
		int m,f,r;
		String s;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			str = br.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){
				s="F";
			}else if(m + f < 30){
				s="F";
			}else if(m + f < 50){
				if(r >= 50){
					s="C";
				}else{
					s="D";
				}
			}else if(m + f < 65){
				s ="C";
			}else if(m + f < 80){
				s = "B";
			}else{
				s = "A";
			}
			System.out.println(s);
		}

		br.close();
	}
}