import java.util.Scanner;

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

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int m, f, r;
        while(true){
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            if(m < 0 && f < 0 && r < 0) break;
            System.out.println(calcGrade(m, f, r));
        }
    }
    public static char calcGrade(int m, int f, int r){
        if(m < 0 || f < 0) 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){
            if(r >= 50){ return 'C'; }else{ return 'D'; }
        }
        return 'F';
    }
}
