import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        } true {
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        } String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int m = Integer.parseInt(line[0]); m Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int f = Integer.parseInt(line[1]); f Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int r = Integer.parseInt(line[2]); r Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } 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){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
                sb.append("F").append("\n");
            } sb.append("F").append("\n") sb.append("F").append sb.append("F") sb.append sb "F" "\n" if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } m + f >= 80 m + f m f 80 {
                sb.append("A").append("\n");
            } sb.append("A").append("\n") sb.append("A").append sb.append("A") sb.append sb "A" "\n" if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } m + f >= 65 m + f m f 65 {
                sb.append("B").append("\n");
            } sb.append("B").append("\n") sb.append("B").append sb.append("B") sb.append sb "B" "\n" if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } m + f >= 50 m + f m f 50 {
                sb.append("C").append("\n");
            } sb.append("C").append("\n") sb.append("C").append sb.append("C") sb.append sb "C" "\n" if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            } m + f >= 30 m + f m f 30 {
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            } if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                } r >= 50 r 50 {
                    sb.append("C").append("\n");
                } sb.append("C").append("\n") sb.append("C").append sb.append("C") sb.append sb "C" "\n" {
                    sb.append("D").append("\n");
                } sb.append("D").append("\n") sb.append("D").append sb.append("D") sb.append sb "D" "\n" {
                sb.append("F").append("\n");
            } sb.append("F").append("\n") sb.append("F").append sb.append("F") sb.append sb "F" "\n" System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    }
} public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    }
} Main
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        while(true){
            String[] line = br.readLine().split(" ");
            int m = Integer.parseInt(line[0]);
            int f = Integer.parseInt(line[1]);
            int r = Integer.parseInt(line[2]);

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                sb.append("F").append("\n");
            }else if(m + f >= 80){
                sb.append("A").append("\n");
            }else if(m + f >= 65){
                sb.append("B").append("\n");
            }else if(m + f >= 50){
                sb.append("C").append("\n");
            }else if(m + f >= 30){
                if(r >= 50){
                    sb.append("C").append("\n");
                }else{
                    sb.append("D").append("\n");
                }
            }else{
                sb.append("F").append("\n");
            }
        }
        System.out.print(sb.toString());
    }
}