import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        }
    }
} import java.util.*; util.* java import java.text.*; text.* java class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        }
    }
} Main public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        } ; {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        } {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        } int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc 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; String c = ""; c "" if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 c = "F" c "F" if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            } m + f >= 80 m + f m f 80 c = "A" c "A" if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            } m + f >= 65 m + f m f 65 c = "B" c "B" if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            } m + f >= 50 m + f m f 50 c = "C" c "C" if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            } m + f >= 30 m + f m f 30 {
                if(r >= 50) c = "C";
                else        c = "D";
            } if(r >= 50) c = "C";
                else        c = "D"; r >= 50 r 50 c = "C" c "C" c = "D" c "D" {
                c = "F";
            } c = "F" c "F" System.out.println(c) System.out.println System.out System System.out c String[]args args
import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String c = "";
            if(m == -1 || f == -1) c = "F";
            else if(m + f >= 80)   c = "A";
            else if(m + f >= 65)   c = "B";
            else if(m + f >= 50)   c = "C";
            else if(m + f >= 30) {
                if(r >= 50) c = "C";
                else        c = "D";
            } else {
                c = "F";
            }
            System.out.println(c);
        }
    }
}