import java.util.*;

public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    }
} import java.util.*; util.* java public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    }
} Main public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    } main {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        } true {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc if (a < 0 && b < 0 && c < 0) break; a < 0 && b < 0 && c < 0 a < 0 && b < 0 && c < 0 a < 0 a 0 b < 0 b 0 c < 0 c 0 break; if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            } a < 0 || b < 0 a < 0 a 0 b < 0 b 0 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            } int s = a + b; s a + b a b if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                } s >= 80 s 80 {
                    System.out.println("A");
                } System.out.println("A") System.out.println System.out System System.out "A" if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                } s >= 65 s 65 {
                    System.out.println("B");
                } System.out.println("B") System.out.println System.out System System.out "B" if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                } s >= 50 s 50 {
                    System.out.println("C");
                } System.out.println("C") System.out.println System.out System System.out "C" if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                } s >= 30 s 30 {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    } c >= 50 c 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" {
                    System.out.println("F");
                } System.out.println("F") System.out.println System.out System System.out "F" String  args[] args public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    }
} public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    }
} Main
import java.util.*;

public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 && b < 0 && c < 0) break;
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                    }
                } else {
                    System.out.println("F");
                }
            }
        }

    }
}