import java.util.Scanner;

class Main{
    public static char grade_1(int m,int f){
	if(m==-1 || f==-1) return 'F';
	if(m+f>=80) return 'A';
	else if(m+f>=65) return 'B';
	else if(m+f>=50) return 'C';	
	else if(m+f>=30) return 'D';
	else return 'F';
    }

    public static char grade_2(int r){
	if(r>=50) return 'C';
	else return 'D';
    }
    
    public static void main(String[] args){
	final Scanner sc=new Scanner(System.in);
	while(true){
	    int m = sc.nextInt();
	    int f = sc.nextInt();
	    int r = sc.nextInt();
	    if(m==-1 && f==-1 && r==-1) break;
	    char g=grade_1(m,f);
	    if(g=='D') g=grade_2(r);
	    System.out.println(g);
	}
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static char grade_1(int m,int f){
	if(m==-1 || f==-1) return 'F';
	if(m+f>=80) return 'A';
	else if(m+f>=65) return 'B';
	else if(m+f>=50) return 'C';	
	else if(m+f>=30) return 'D';
	else return 'F';
    }

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

class Main{
    public static char grade_1(int m,int f){
	if(m==-1 || f==-1) return 'F';
	if(m+f>=80) return 'A';
	else if(m+f>=65) return 'B';
	else if(m+f>=50) return 'C';	
	else if(m+f>=30) return 'D';
	else return 'F';
    }

    public static char grade_2(int r){
	if(r>=50) return 'C';
	else return 'D';
    }
    
    public static void main(String[] args){
	final Scanner sc=new Scanner(System.in);
	while(true){
	    int m = sc.nextInt();
	    int f = sc.nextInt();
	    int r = sc.nextInt();
	    if(m==-1 && f==-1 && r==-1) break;
	    char g=grade_1(m,f);
	    if(g=='D') g=grade_2(r);
	    System.out.println(g);
	}
    }
}