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