import java.util.*;

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

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        while(sc.hasNext()) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if (m==-1&&f==-1&&r==-1) break;
            String ret;
            if (m==-1||f==-1) {
                ret = "F";
            } else if (m+f>=80) {
                ret = "A";
            } else if (m+f>=65) {
                ret = "B";
            } else if (m+f>=50) {
                ret = "C";
            } else if (m+f>=30) {
                if (r>=50) {
                    ret = "C";
                } else {
                    ret = "D";
                }
            } else {
                ret = "F";
            }
            
            System.out.println(ret);
        }
    }
}