import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input;
        int m, f, r, sum;
        char grade;

        while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        }
    }
} import java.io.*; io.* java class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input;
        int m, f, r, sum;
        char grade;

        while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        }
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input;
        int m, f, r, sum;
        char grade;

        while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input;
        int m, f, r, sum;
        char grade;

        while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] input; input int m m f f r r sum; sum char grade; grade while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        } true {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        } input = br.readLine().split(" ") input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(input[0]) m Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 f = Integer.parseInt(input[1]) f Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 r = Integer.parseInt(input[2]) r Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 sum = m + f sum 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;
            } break; if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            } m == -1 || f == -1 || sum < 30 m == -1 || f == -1 || sum < 30 m == -1 m -1 1 f == -1 f -1 1 sum < 30 sum 30 {
                grade = 'F';
            } grade = 'F' grade 'F' if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            } sum >= 80 sum 80 {
                grade = 'A';
            } grade = 'A' grade 'A' if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            } sum >= 65 sum 65 {
                grade = 'B';
            } grade = 'B' grade 'B' if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            } sum >= 50 || (sum >= 30 && r >= 50) sum >= 50 sum 50 (sum >= 30 && r >= 50) sum >= 30 sum 30 r >= 50 r 50 {
                grade = 'C';
            } grade = 'C' grade 'C' {
                grade = 'D';
            } grade = 'D' grade 'D' System.out.println(grade) System.out.println System.out System System.out grade String[] args args
import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input;
        int m, f, r, sum;
        char grade;

        while (true) {
            input = br.readLine().split(" ");
            m = Integer.parseInt(input[0]);
            f = Integer.parseInt(input[1]);
            r = Integer.parseInt(input[2]);
            sum = m + f;

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            if (m == -1 || f == -1 || sum < 30) {
                grade = 'F';
            } else if (sum >= 80) {
                grade = 'A';
            } else if (sum >= 65) {
                grade = 'B';
            } else if (sum >= 50 || (sum >= 30 && r >= 50)) {
                grade = 'C';
            } else {
                grade = 'D';
            }

            System.out.println(grade);
        }
    }
}