import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int r = scanner.nextInt(); r scanner.nextInt() scanner.nextInt scanner while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        } m >= 0 || f >= 0 m >= 0 m 0 f >= 0 f 0 {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        } char grade = ' '; grade ' ' int mf = m + f; mf m + f m f if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F'; m < 0 || f < 0 m < 0 m 0 f < 0 f 0 grade = 'F' grade 'F' if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F'; mf >= 80 mf 80 grade = 'A' grade 'A' if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F'; 65 <= mf && mf < 80 65 <= mf 65 mf mf < 80 mf 80 grade = 'B' grade 'B' if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F'; 50 <= mf && mf < 65 50 <= mf 50 mf mf < 65 mf 65 grade = 'C' grade 'C' if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F'; 30 <= mf && mf < 50 30 <= mf 30 mf mf < 50 mf 50 {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } grade = 'D' grade 'D' if (r >= 50) grade = 'C'; r >= 50 r 50 grade = 'C' grade 'C' if (mf < 30) grade = 'F'; mf < 30 mf 30 grade = 'F' grade 'F' System.out.println(grade) System.out.println System.out System System.out grade m = scanner.nextInt() m scanner.nextInt() scanner.nextInt scanner f = scanner.nextInt() f scanner.nextInt() scanner.nextInt scanner r = scanner.nextInt() r scanner.nextInt() scanner.nextInt scanner String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
    while (m >= 0 || f >= 0) {
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
}
