import java.util.Scanner;
public class Main {
    public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    }
    // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    }
    // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    }

} Main public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    } main {
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    } Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        } ; {
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        } {
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        } int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            } 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){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            } if(m == -1){
                    notM(m, f, r);
                } m == -1 m -1 1 {
                    notM(m, f, r);
                } notM(m, f, r) notM m f r if(f == -1){
                    notF(m, f, r);
                } f == -1 f -1 1 {
                    notF(m, f, r);
                } notF(m, f, r) notF m f r if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                } m != -1 && f != -1 m != -1 m -1 1 f != -1 f -1 1 {
                    Seiseki(m, f, r);
                } Seiseki(m, f, r) Seiseki m f r String[] aegs aegs // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    } notM {
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    } System.out.println("F") System.out.println System.out System System.out "F" int m m int f f int r r // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    } notF {
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    } System.out.println("F") System.out.println System.out System System.out "F" int m m int f f int r r // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    } Seiseki {
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    } if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        } m + f >= 80 && r == -1 m + f >= 80 m + f m f 80 r == -1 r -1 1 {
            System.out.println("A");
        } System.out.println("A") System.out.println System.out System System.out "A" if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        } (m + f < 80 && m + f >= 65) && r == -1 (m + f < 80 && m + f >= 65) m + f < 80 m + f m f 80 m + f >= 65 m + f m f 65 r == -1 r -1 1 {
            System.out.println("B");
        } System.out.println("B") System.out.println System.out System System.out "B" if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        } (m + f < 65 && m + f >= 50) m + f < 65 m + f m f 65 m + f >= 50 m + f m f 50 {
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        } if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            } r == -1 r -1 1 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if(r >= 50){
                System.out.println("C");
            } r >= 50 r 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        } m + f < 50 && m + f >= 30 m + f < 50 m + f m f 50 m + f >= 30 m + f m f 30 {
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        } if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } r >= 50 r 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" {
                System.out.println("D");
            } System.out.println("D") System.out.println System.out System System.out "D" if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        } (m + f < 30) && (r == -1 || r >= 0) (m + f < 30) m + f m f 30 (r == -1 || r >= 0) r == -1 r -1 1 r >= 0 r 0 {
            System.out.println("F");
        } System.out.println("F") System.out.println System.out System System.out "F" int m m int f f int r r public class Main {
    public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    }
    // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    }

} public class Main {
    public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    }
    // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    }

} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] aegs){
        Scanner scan = new java.util.Scanner(System.in);
        for(;;){
            int m = scan.nextInt(); // ???????????????
            int f = scan.nextInt(); // ???????????????
            int r = scan.nextInt(); // ???????¨?
            if(m == -1 && f == -1 && r == -1){
                break;
            }else{
                if(m == -1){
                    notM(m, f, r);
                }
                if(f == -1){
                    notF(m, f, r);
                }
                if(m != -1 && f != -1){
                    Seiseki(m, f, r);
                }
            }
        }
    }
    // m == -1
    public static void notM(int m, int f, int r){
        /*if(f >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(f >= 30 && r >= 50){
            System.out.println("c");
        }else if(f < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // f == -1
    public static void notF(int m, int f, int r){
        /*if(m >= 30 && (r == -1 || r < 50)){
            System.out.println("D");
        }else if(m >= 30 && r >= 50){
            System.out.println("c");
        }else if(m < 30 && r == -1){
            System.out.println("F");
        }*/
        System.out.println("F");
    }
    // m != -1 && f != -1
    public static void Seiseki(int m, int f, int r){
        if(m + f >= 80 && r == -1){
            System.out.println("A");
        }else if((m + f < 80 && m + f >= 65) && r == -1){
            System.out.println("B");
        }else if((m + f < 65 && m + f >= 50)){
            if(r == -1){
                System.out.println("C");
            }else if(r >= 50){
                System.out.println("C");
            }
        }else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }else if((m + f < 30) && (r == -1 || r >= 0)){
            System.out.println("F");
        }
    }

}