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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        } true {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        } String[] lines = br.readLine().split(" "); lines br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int s1 = Integer.parseInt(lines[0]); s1 Integer.parseInt(lines[0]) Integer.parseInt Integer lines[0] lines 0 int s2 = Integer.parseInt(lines[1]); s2 Integer.parseInt(lines[1]) Integer.parseInt Integer lines[1] lines 1 int s3 = Integer.parseInt(lines[2]); s3 Integer.parseInt(lines[2]) Integer.parseInt Integer lines[2] lines 2 if (s1 + s2 + s3 == -3) {
                break;
            } s1 + s2 + s3 == -3 s1 + s2 + s3 s1 + s2 + s3 s1 s2 s3 -3 3 {
                break;
            } break; int sum = s1 + s2; sum s1 + s2 s1 s2 String result = ""; result "" if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            } s1 == -1 || s2 == -1 s1 == -1 s1 -1 1 s2 == -1 s2 -1 1 {
                result="F";
            } result="F" result "F" if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            } sum >= 80 sum 80 {
                result = "A";
            } result = "A" result "A" if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            } sum >= 65 sum 65 {
                result = "B";
            } result = "B" result "B" if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            } sum >= 50 sum 50 {
                result = "C";
            } result = "C" result "C" if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            } sum >= 30 sum 30 {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } result = "D" result "D" if (s3 >= 50) {
                    result = "C";
                } s3 >= 50 s3 50 {
                    result = "C";
                } result = "C" result "C" {
                result = "F";
            } result = "F" result "F" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] lines = br.readLine().split(" ");
            int s1 = Integer.parseInt(lines[0]);
            int s2 = Integer.parseInt(lines[1]);
            int s3 = Integer.parseInt(lines[2]);
            if (s1 + s2 + s3 == -3) {
                break;
            }
            int sum = s1 + s2;
            String result = "";
            if (s1 == -1 || s2 == -1) {
                result="F";
            } else if (sum >= 80) {
                result = "A";
            } else if (sum >= 65) {
                result = "B";
            } else if (sum >= 50) {
                result = "C";
            } else if (sum >= 30) {
                result = "D";
                if (s3 >= 50) {
                    result = "C";
                }
            } else {
                result = "F";
            }
            System.out.println(result);
        }
    }
}