
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int tyuukan = scan.nextInt();
        int kimatu = scan.nextInt();
        int saisiken = scan.nextInt();
        while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        }
    }
}
 import java.util.Scanner; Scanner java.util class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int tyuukan = scan.nextInt();
        int kimatu = scan.nextInt();
        int saisiken = scan.nextInt();
        while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        }
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int tyuukan = scan.nextInt();
        int kimatu = scan.nextInt();
        int saisiken = scan.nextInt();
        while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int tyuukan = scan.nextInt();
        int kimatu = scan.nextInt();
        int saisiken = scan.nextInt();
        while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int tyuukan = scan.nextInt(); tyuukan scan.nextInt() scan.nextInt scan int kimatu = scan.nextInt(); kimatu scan.nextInt() scan.nextInt scan int saisiken = scan.nextInt(); saisiken scan.nextInt() scan.nextInt scan while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        } tyuukan != -1 || kimatu != -1 || saisiken != -1 tyuukan != -1 || kimatu != -1 || saisiken != -1 tyuukan != -1 tyuukan -1 1 kimatu != -1 kimatu -1 1 saisiken != -1 saisiken -1 1 {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        } int y; y y = tyuukan + kimatu y tyuukan + kimatu tyuukan kimatu if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            } tyuukan == -1 || kimatu == -1 tyuukan == -1 tyuukan -1 1 kimatu == -1 kimatu -1 1 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            } y >= 80 y 80 {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            } y >= 65 && y < 80 y >= 65 y 65 y < 80 y 80 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            } y >= 50 && y < 65 y >= 50 y 50 y < 65 y 65 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            } y >= 30 && y < 50 y >= 30 y 30 y < 50 y 50 {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                } saisiken >= 50 saisiken 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" tyuukan = scan.nextInt() tyuukan scan.nextInt() scan.nextInt scan kimatu = scan.nextInt() kimatu scan.nextInt() scan.nextInt scan saisiken = scan.nextInt() saisiken scan.nextInt() scan.nextInt scan String[] args args

import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int tyuukan = scan.nextInt();
        int kimatu = scan.nextInt();
        int saisiken = scan.nextInt();
        while (tyuukan != -1 || kimatu != -1 || saisiken != -1) {
            int y;
            y = tyuukan + kimatu;
            if (tyuukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (y >= 80) {
                System.out.println("A");
            } else if (y >= 65 && y < 80) {
                System.out.println("B");
            } else if (y >= 50 && y < 65) {
                System.out.println("C");
            } else if (y >= 30 && y < 50) {
                if (saisiken >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
            tyuukan = scan.nextInt();
            kimatu = scan.nextInt();
            saisiken = scan.nextInt();
        }
    }
}

