import java.io.IOException;
import java.util.Scanner;
public class Main {

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

} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

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

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

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

} public class Main {

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

} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {

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

}