import java.util.Scanner;

public class Main {

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

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

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

public class Main {

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