import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	}
} Main public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	} main {
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int m m f f r r point; point while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		} true {
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		} point=0 point 0 m=scan.nextInt() m scan.nextInt() scan.nextInt scan f=scan.nextInt() f scan.nextInt() scan.nextInt scan r=scan.nextInt() r scan.nextInt() scan.nextInt scan 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){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			} m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			} point+=(m+f) point (m+f) m f if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				} 80<=point 80 point {
					System.out.println("A");
				} System.out.println("A") System.out.println System.out System System.out "A" if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				} 65<=point&&point<80 65<=point 65 point point<80 point 80 {
					System.out.println("B");
				} System.out.println("B") System.out.println System.out System System.out "B" if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				} 50<=point&&point<65 50<=point 50 point point<65 point 65 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				} 30<=point&&point<50 30<=point 30 point point<50 point 50 {
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				} if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					} 50<=r 50 r {
						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" scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		int m,f,r,point;
		while(true){
			point=0;
			m=scan.nextInt();
			f=scan.nextInt();
			r=scan.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			if(m==-1||f==-1){
				System.out.println("F");
			}else{
				point+=(m+f);
				if(80<=point){
					System.out.println("A");
				}else if(65<=point&&point<80){
					System.out.println("B");
				}else if(50<=point&&point<65){
					System.out.println("C");
				}else if(30<=point&&point<50){
					if(50<=r){
						System.out.println("C");
					}else{
						System.out.println("D");
					}
				}else{
					System.out.println("F");
				}
			}
		}
		scan.close();
	}
}