import java.util.*;

public class Main {


	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner scan = new Scanner(System.in);
		int m,f,r;
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m+f+r==-3) break;
			int s = m+f;
			if(m==-1||f==-1) {System.out.println("F"); continue;}
			if(s>=80) System.out.println("A");
			if(s>=65&&s<80) System.out.println("B");
			if(s>=50&&s<65) System.out.println("C");
			if(s>=30&&s<50){
				if(r>=50) System.out.println("C");
				else System.out.println("D");
			}
			if(s<30) System.out.println("F");
		}
	}
} import java.util.*; util.* java public class Main {


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


	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner scan = new Scanner(System.in);
		int m,f,r;
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m+f+r==-3) break;
			int s = m+f;
			if(m==-1||f==-1) {System.out.println("F"); continue;}
			if(s>=80) System.out.println("A");
			if(s>=65&&s<80) System.out.println("B");
			if(s>=50&&s<65) System.out.println("C");
			if(s>=30&&s<50){
				if(r>=50) System.out.println("C");
				else System.out.println("D");
			}
			if(s<30) System.out.println("F");
		}
	}
} public class Main {


	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner scan = new Scanner(System.in);
		int m,f,r;
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m+f+r==-3) break;
			int s = m+f;
			if(m==-1||f==-1) {System.out.println("F"); continue;}
			if(s>=80) System.out.println("A");
			if(s>=65&&s<80) System.out.println("B");
			if(s>=50&&s<65) System.out.println("C");
			if(s>=30&&s<50){
				if(r>=50) System.out.println("C");
				else System.out.println("D");
			}
			if(s<30) System.out.println("F");
		}
	}
} Main
import java.util.*;

public class Main {


	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner scan = new Scanner(System.in);
		int m,f,r;
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m+f+r==-3) break;
			int s = m+f;
			if(m==-1||f==-1) {System.out.println("F"); continue;}
			if(s>=80) System.out.println("A");
			if(s>=65&&s<80) System.out.println("B");
			if(s>=50&&s<65) System.out.println("C");
			if(s>=30&&s<50){
				if(r>=50) System.out.println("C");
				else System.out.println("D");
			}
			if(s<30) System.out.println("F");
		}
	}
}