import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;

public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


} import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.IOException; IOException java.io public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


} Main public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw new BufferedWriter(new OutputStreamWriter(System.out)) String input; input while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        } !(input = br.readLine()).equals("-1 -1 -1") (input = br.readLine()).equals("-1 -1 -1") (input = br.readLine()).equals (input = br.readLine()) input br.readLine() br.readLine br "-1 -1 -1" {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        } String[] st = input.split(" "); st input.split(" ") input.split input " " int m = Integer.parseInt(st[0]); m Integer.parseInt(st[0]) Integer.parseInt Integer st[0] st 0 int f = Integer.parseInt(st[1]); f Integer.parseInt(st[1]) Integer.parseInt Integer st[1] st 1 int r = Integer.parseInt(st[2]); r Integer.parseInt(st[2]) Integer.parseInt Integer st[2] st 2 if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            } m < 0 || f < 0 m < 0 m 0 f < 0 f 0 {
                bw.append("F\n");
                continue;
            } bw.append("F\n") bw.append bw "F\n" continue; int score = (m > 0 ? m : 0); score (m > 0 ? m : 0) m > 0 m 0 m 0 score += (f > 0 ? f : 0) score (f > 0 ? f : 0) f > 0 f 0 f 0 if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            } score >= 80 score 80 {
                bw.append("A");
            } bw.append("A") bw.append bw "A" if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            } score >= 65 score 65 {
                bw.append("B");
            } bw.append("B") bw.append bw "B" if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            } score >= 50 score 50 {
                bw.append("C");
            } bw.append("C") bw.append bw "C" if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            } score >= 30 score 30 {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                } r >= 50 r 50 {
                    bw.append("C");
                } bw.append("C") bw.append bw "C" {
                    bw.append("D");
                } bw.append("D") bw.append bw "D" {
                bw.append("F");
            } bw.append("F") bw.append bw "F" bw.newLine() bw.newLine bw bw.flush() bw.flush bw String args[] args public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


} public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


} Main
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;

public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


}
