import java.util.Scanner;
public class Main{
    public static void main(String args[]){
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    }
}
	
	 import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String args[]){
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    }
} Main public static void main(String args[]){
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    } main {
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    } Scanner in =new Scanner(System.in); in new Scanner(System.in) int m m f f r; r String grade; grade while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	} true {
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

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

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    }
} public class Main{
    public static void main(String args[]){
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
	Scanner in =new Scanner(System.in);

	int m,f,r;
	String grade; 
	while(true){
	    m = in.nextInt();
	    f = in.nextInt();
	    r = in.nextInt();

	    int score = m+f;
	    if(m == -1 && f == -1 && r == -1)break;

	    if(m == -1 || f == -1)grade = "F";
	    else if(score >= 80)grade = "A";
	    else if(score >= 65 && score<80)grade = "B";
	    else if(score >= 50 && score<65)grade = "C";
	    else if(score>=30 && score <50){
		grade = "D";
		if(r>=50)grade ="C";
	    }else grade = "F";
	    System.out.println(grade);
	}

    }
}
	
	
