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

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    }
} Main public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    } main {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    } try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        } Exception e {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        } System.out.println(e) System.out.println System.out System System.out e e.getStackTrace() e.getStackTrace e System.exit(-1) System.exit System -1 1 {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in)); stdReader new BufferedReader(new InputStreamReader(System.in)) String line; line while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            } (line = stdReader.readLine()) != null (line = stdReader.readLine()) line stdReader.readLine() stdReader.readLine stdReader null {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            } String[] input = line.split(" ", 0); input line.split(" ", 0) line.split line " " 0 int midtermExam = Integer.parseInt(input[0]); midtermExam Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 int finalExam   = Integer.parseInt(input[1]); finalExam Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 int additional  = Integer.parseInt(input[2]); additional Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                } midtermExam == -1 && finalExam == -1 && additional == -1 midtermExam == -1 && finalExam == -1 && additional == -1 midtermExam == -1 midtermExam -1 1 finalExam == -1 finalExam -1 1 additional == -1 additional -1 1 {
                    break;
                } break; if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                } midtermExam == -1 || finalExam == -1 midtermExam == -1 midtermExam -1 1 finalExam == -1 finalExam -1 1 {
                    System.out.println("F");
                    continue;
                } System.out.println("F") System.out.println System.out System System.out "F" continue; int addScore = midtermExam + finalExam; addScore midtermExam + finalExam midtermExam finalExam if(addScore < 30) {
                    System.out.println("F");
                    continue;
                } addScore < 30 addScore 30 {
                    System.out.println("F");
                    continue;
                } System.out.println("F") System.out.println System.out System System.out "F" continue; if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                } addScore >= 30 && addScore < 50 addScore >= 30 addScore 30 addScore < 50 addScore 50 {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                } if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    } additional >= 50 additional 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" continue; if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                } addScore >= 50 && addScore < 65 addScore >= 50 addScore 50 addScore < 65 addScore 65 {
                    System.out.println("C");
                    continue;
                } System.out.println("C") System.out.println System.out System System.out "C" continue; if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                } addScore >= 65 && addScore < 80 addScore >= 65 addScore 65 addScore < 80 addScore 80 {
                    System.out.println("B");
                    continue;
                } System.out.println("B") System.out.println System.out System System.out "B" continue; if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                } addScore >= 80 addScore 80 {
                    System.out.println("A");
                    continue;
                } System.out.println("A") System.out.println System.out System System.out "A" continue; stdReader.close() stdReader.close stdReader String[] args args public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int midtermExam = Integer.parseInt(input[0]);
                int finalExam   = Integer.parseInt(input[1]);
                int additional  = Integer.parseInt(input[2]);
                
                // ????????¨???-1????????????
                if(midtermExam == -1 && finalExam == -1 && additional == -1) {
                    break;
                }
                
                // ???????????????????????????????????????????????´????????¶??????F
                if(midtermExam == -1 || finalExam == -1) {
                    System.out.println("F");
                    continue;
                }
                
                int addScore = midtermExam + finalExam;
                
                // ????¨??????°???30?????????F
                if(addScore < 30) {
                    System.out.println("F");
                    continue;
                }
                
                // ????¨??????°???30??\???50????????§D
                // ??????????????????50??\?????§C
                if(addScore >= 30 && addScore < 50) {
                    if(additional >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                    continue;
                }
                
                // ????¨??????°???50??\???65????????§C
                if(addScore >= 50 && addScore < 65) {
                    System.out.println("C");
                    continue;
                }
                
                // ????¨??????°???65??\???80????????§B
                if(addScore >= 65 && addScore < 80) {
                    System.out.println("B");
                    continue;
                }
                
                // ????¨??????°???80??\?????§A
                if(addScore >= 80) {
                    System.out.println("A");
                    continue;
                }
            }
            stdReader.close();
        } catch(Exception e) {
            System.out.println(e);
            e.getStackTrace();
            System.exit(-1);
        }
    }
}