
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

class StudentResult {

    int middle_point; // 中間試験の点数
    int final_point; // 期末試験
    int retest_point; // 再試験

    public StudentResult(int middle_point, int final_point, int retest_point) {
        this.middle_point = middle_point;
        this.final_point = final_point;
        this.retest_point = retest_point;
    }

    public int getFinal_point() {
        return final_point;
    }

    public int getMiddle_point() {
        return middle_point;
    }

    public int getRetest_point() {
        return retest_point;
    }

    public void setFinal_point(int final_point) {
        this.final_point = final_point;
    }

    public void setMiddle_point(int middle_point) {
        this.middle_point = middle_point;
    }

    public void setRetest_point(int retest_point) {
        this.retest_point = retest_point;
    }

}

/**
 *
 * @author k16069kk
 */
public class Main {

    public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    }

    public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.StringTokenizer; StringTokenizer java.util class StudentResult {

    int middle_point; // 中間試験の点数
    int final_point; // 期末試験
    int retest_point; // 再試験

    public StudentResult(int middle_point, int final_point, int retest_point) {
        this.middle_point = middle_point;
        this.final_point = final_point;
        this.retest_point = retest_point;
    }

    public int getFinal_point() {
        return final_point;
    }

    public int getMiddle_point() {
        return middle_point;
    }

    public int getRetest_point() {
        return retest_point;
    }

    public void setFinal_point(int final_point) {
        this.final_point = final_point;
    }

    public void setMiddle_point(int middle_point) {
        this.middle_point = middle_point;
    }

    public void setRetest_point(int retest_point) {
        this.retest_point = retest_point;
    }

} StudentResult int middle_point; // 中間試験の点数 middle_point int final_point; // 期末試験 final_point int retest_point; // 再試験 retest_point public StudentResult(int middle_point, int final_point, int retest_point) {
        this.middle_point = middle_point;
        this.final_point = final_point;
        this.retest_point = retest_point;
    } StudentResult {
        this.middle_point = middle_point;
        this.final_point = final_point;
        this.retest_point = retest_point;
    } this.middle_point = middle_point this.middle_point this this.middle_point middle_point this.final_point = final_point this.final_point this this.final_point final_point this.retest_point = retest_point this.retest_point this this.retest_point retest_point int middle_point middle_point int final_point final_point int retest_point retest_point public int getFinal_point() {
        return final_point;
    } getFinal_point {
        return final_point;
    } return final_point; final_point public int getMiddle_point() {
        return middle_point;
    } getMiddle_point {
        return middle_point;
    } return middle_point; middle_point public int getRetest_point() {
        return retest_point;
    } getRetest_point {
        return retest_point;
    } return retest_point; retest_point public void setFinal_point(int final_point) {
        this.final_point = final_point;
    } setFinal_point {
        this.final_point = final_point;
    } this.final_point = final_point this.final_point this this.final_point final_point int final_point final_point public void setMiddle_point(int middle_point) {
        this.middle_point = middle_point;
    } setMiddle_point {
        this.middle_point = middle_point;
    } this.middle_point = middle_point this.middle_point this this.middle_point middle_point int middle_point middle_point public void setRetest_point(int retest_point) {
        this.retest_point = retest_point;
    } setRetest_point {
        this.retest_point = retest_point;
    } this.retest_point = retest_point this.retest_point this this.retest_point retest_point int retest_point retest_point public class Main {

    public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    }

    public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    }

} Main public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    } result {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    } if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        } !(mid == -1 && fin == -1 && re == -1) (mid == -1 && fin == -1 && re == -1) mid == -1 && fin == -1 && re == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 re == -1 re -1 1 {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        } if (mid == -1 || fin == -1) {
                return "F";
            } mid == -1 || fin == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 {
                return "F";
            } return "F"; "F" if (mid + fin >= 80) {
                return "A";
            } mid + fin >= 80 mid + fin mid fin 80 {
                return "A";
            } return "A"; "A" if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            } mid + fin >= 65 && mid + fin < 80 mid + fin >= 65 mid + fin mid fin 65 mid + fin < 80 mid + fin mid fin 80 {
                return "B";
            } return "B"; "B" if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            } (mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50) (mid + fin >= 50 && mid + fin < 65) mid + fin >= 50 mid + fin mid fin 50 mid + fin < 65 mid + fin mid fin 65 ((mid + fin >= 30 && mid + fin < 50) && re >= 50) (mid + fin >= 30 && mid + fin < 50) mid + fin >= 30 mid + fin mid fin 30 mid + fin < 50 mid + fin mid fin 50 re >= 50 re 50 {
                return "C";
            } return "C"; "C" if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            } mid + fin >= 30 && mid + fin < 50 mid + fin >= 30 mid + fin mid fin 30 mid + fin < 50 mid + fin mid fin 50 {
                return "D";
            } return "D"; "D" if (mid + fin < 30) {
                return "F";
            } mid + fin < 30 mid + fin mid fin 30 {
                return "F";
            } return "F"; "F" return "-1"; "-1" int mid mid int fin fin int re re public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    } print {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    } switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        } res case "A": "A" case "A": System.out.println("A") System.out.println System.out System System.out "A" break; case "B": "B" case "B": System.out.println("B") System.out.println System.out System System.out "B" break; case "C": "C" case "C": System.out.println("C") System.out.println System.out System System.out "C" break; case "D": "D" case "D": System.out.println("D") System.out.println System.out System System.out "D" break; case "F": "F" case "F": System.out.println("F") System.out.println System.out System System.out "F" break; case "-1": "-1" case "-1": break; String res res /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    } main {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    } int index = 0; index 0 List<StudentResult> list = new ArrayList<>(); list new ArrayList<>() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line; line while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        } java.util.StringTokenizer st = new StringTokenizer(line, " "); st new StringTokenizer(line, " ") while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            } st.hasMoreTokens() st.hasMoreTokens st {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            } int m = Integer.parseInt(st.nextToken()); m Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int f = Integer.parseInt(st.nextToken()); f Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int r = Integer.parseInt(st.nextToken()); r Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st StudentResult sr = new StudentResult(m, f, r); sr new StudentResult(m, f, r) list.add(sr) list.add list sr if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            } list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1 list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1 list.get(index).getFinal_point() == -1 list.get(index).getFinal_point() list.get(index).getFinal_point list.get(index) list.get list index -1 1 list.get(index).getMiddle_point() == -1 list.get(index).getMiddle_point() list.get(index).getMiddle_point list.get(index) list.get list index -1 1 list.get(index).getRetest_point() == -1 list.get(index).getRetest_point() list.get(index).getRetest_point list.get(index) list.get list index -1 1 {
                break;
            } break; index++ index for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        } StudentResult list1 list {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        } {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        } print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point())) print result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()) result list1.getMiddle_point() list1.getMiddle_point list1 list1.getFinal_point() list1.getFinal_point list1 list1.getRetest_point() list1.getRetest_point list1 String[] args args public class Main {

    public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    }

    public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    }

} public class Main {

    public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    }

    public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    }

} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

class StudentResult {

    int middle_point; // 中間試験の点数
    int final_point; // 期末試験
    int retest_point; // 再試験

    public StudentResult(int middle_point, int final_point, int retest_point) {
        this.middle_point = middle_point;
        this.final_point = final_point;
        this.retest_point = retest_point;
    }

    public int getFinal_point() {
        return final_point;
    }

    public int getMiddle_point() {
        return middle_point;
    }

    public int getRetest_point() {
        return retest_point;
    }

    public void setFinal_point(int final_point) {
        this.final_point = final_point;
    }

    public void setMiddle_point(int middle_point) {
        this.middle_point = middle_point;
    }

    public void setRetest_point(int retest_point) {
        this.retest_point = retest_point;
    }

}

/**
 *
 * @author k16069kk
 */
public class Main {

    public static String result(int mid, int fin, int re) {
        if (!(mid == -1 && fin == -1 && re == -1)) {
            if (mid == -1 || fin == -1) {
                return "F";
            }

            if (mid + fin >= 80) {
                return "A";
            }

            if (mid + fin >= 65 && mid + fin < 80) {
                return "B";
            }

            if ((mid + fin >= 50 && mid + fin < 65)
                    || ((mid + fin >= 30 && mid + fin < 50) && re >= 50)) {
                return "C";
            }

            if (mid + fin >= 30 && mid + fin < 50) {
                return "D";
            }

            if (mid + fin < 30) {
                return "F";
            }
        }
        return "-1";
    }

    public static void print(String res) {
        switch (res) {
            case "A":
                System.out.println("A");
                break;
            case "B":
                System.out.println("B");
                break;
            case "C":
                System.out.println("C");
                break;
            case "D":
                System.out.println("D");
                break;
            case "F":
                System.out.println("F");
                break;
            case "-1":
                break;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int index = 0;
        List<StudentResult> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            while (st.hasMoreTokens()) {
                int m = Integer.parseInt(st.nextToken());
                int f = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                StudentResult sr = new StudentResult(m, f, r);
                list.add(sr);
            }
            if (list.get(index).getFinal_point() == -1
                    && list.get(index).getMiddle_point() == -1
                    && list.get(index).getRetest_point() == -1) {
                break;
            }
            index++;
        }

        for (StudentResult list1 : list) {
            print(result(list1.getMiddle_point(),
                            list1.getFinal_point(),
                            list1.getRetest_point()));
        }

    }

}

