import java.util.Scanner;

/**
 * Structured Program II
 */
public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    }
} Main private static Scanner scan; scan public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    } main {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    } scan = new Scanner(System.in) scan new Scanner(System.in) int m m f f r r sum; sum String seiseki = ""; seiseki "" while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        } true {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        } 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 sum = m + f sum m + f m f if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } m == -1 && f == -1 m == -1 m -1 1 f == -1 f -1 1 {
                return;
            } return; if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } m < 0 || f < 0 m < 0 m 0 f < 0 f 0 {
                seiseki = "F";
            } seiseki = "F" seiseki "F" if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } sum >= 80 sum 80 {
                seiseki = "A";
            } seiseki = "A" seiseki "A" if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 {
                seiseki = "B";
            } seiseki = "B" seiseki "B" if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } sum >= 50 && sum < 65 sum >= 50 sum 50 sum < 65 sum 65 {
                seiseki = "C";
            } seiseki = "C" seiseki "C" if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            } sum >= 30 && sum < 50 sum >= 30 sum 30 sum < 50 sum 50 {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } seiseki = "D" seiseki "D" if (r >= 50) {
                    seiseki = "C";
                } r >= 50 r 50 {
                    seiseki = "C";
                } seiseki = "C" seiseki "C" if (sum < 30) {
                seiseki = "F";
            } sum < 30 sum 30 {
                seiseki = "F";
            } seiseki = "F" seiseki "F" System.out.println(seiseki) System.out.println System.out System System.out seiseki String[] args args public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    }
} public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    }
} Main
import java.util.Scanner;

/**
 * Structured Program II
 */
public class Main {
    private static Scanner scan;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // 中間試験の点数 m、期末試験の点数 f、再試験の点数 r
        int m,f,r, sum;
        String seiseki = "";
        while (true) {
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if (m == -1 && f == -1) {
                return;
            } else if (m < 0 || f < 0) {
                seiseki = "F";
            } else if (sum >= 80) {
                seiseki = "A";
            } else if (sum >= 65 && sum < 80) {
                seiseki = "B";
            } else if (sum >= 50 && sum < 65) {
                seiseki = "C";
            } else if (sum >= 30 && sum < 50) {
                seiseki = "D";
                if (r >= 50) {
                    seiseki = "C";
                }
            } else if (sum < 30) {
                seiseki = "F";
            }
            System.out.println(seiseki);
        }
    }
}