import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    } main {
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        } true {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc if(a == -1 && b == -1 && c == -1) break; a == -1 && b == -1 && c == -1 a == -1 && b == -1 && c == -1 a == -1 a -1 1 b == -1 b -1 1 c == -1 c -1 1 break; int sum = a + b; sum a + b a b char grade; grade if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            } a == -1 || b == -1 a == -1 a -1 1 b == -1 b -1 1 {
                grade = 'F';
            } grade = 'F' grade 'F' if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            } sum >= 80 sum 80 {
                grade = 'A';
            } grade = 'A' grade 'A' if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            } sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 {
                grade = 'B';
            } grade = 'B' grade 'B' if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            } sum >= 50 && sum < 65 sum >= 50 sum 50 sum < 65 sum 65 {
                grade = 'C';
            } grade = 'C' grade 'C' if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            } sum >= 30 && sum < 50 sum >= 30 sum 30 sum < 50 sum 50 {
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            } if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                } c >= 50 c 50 {
                    grade = 'C';
                } grade = 'C' grade 'C' {
                    grade = 'D';
                } grade = 'D' grade 'D' {
                grade = 'F';
            } 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 sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            
            if(a == -1 && b == -1 && c == -1) break;
            
            int sum = a + b;
            
            char grade;
            
            if(a == -1 || b == -1){
                grade = 'F';
            }else if(sum >= 80){
                grade = 'A';
            }else if(sum >= 65 && sum < 80){
                grade = 'B';
            }else if(sum >= 50 && sum < 65){
                grade = 'C';
            }else if(sum >= 30 && sum < 50){
                if(c >= 50){
                    grade = 'C';
                }else{
                    grade = 'D';
                }
            }else{
                grade = 'F';
            }
            System.out.println(grade);
            
        }
    }
}
