import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int j = 0; j 0 while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        } j == 0 j 0 {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        } int tyukan = scanner.nextInt(); tyukan scanner.nextInt() scanner.nextInt scanner int kimatu = scanner.nextInt(); kimatu scanner.nextInt() scanner.nextInt scanner int saishi = scanner.nextInt(); saishi scanner.nextInt() scanner.nextInt scanner if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } tyukan == -1 && kimatu == -1 && saishi == -1 tyukan == -1 && kimatu == -1 && saishi == -1 tyukan == -1 tyukan -1 1 kimatu == -1 kimatu -1 1 saishi == -1 saishi -1 1 {
                break; 
            } break; if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } tyukan==-1||kimatu==-1 tyukan==-1 tyukan -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 ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } (tyukan + kimatu) >= 80 (tyukan + kimatu) tyukan kimatu 80 {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } (tyukan + kimatu) >= 65 (tyukan + kimatu) tyukan kimatu 65 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } (tyukan + kimatu) >= 50||saishi>=50 (tyukan + kimatu) >= 50 (tyukan + kimatu) tyukan kimatu 50 saishi>=50 saishi 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            } (tyukan + kimatu) >= 30 (tyukan + kimatu) tyukan kimatu 30 {
                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 scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int j = 0;

        while (j == 0) {
            int tyukan = scanner.nextInt();
            int kimatu = scanner.nextInt();
            int saishi = scanner.nextInt();

            if (tyukan == -1 && kimatu == -1 && saishi == -1) {
                break; 
            }else if(tyukan==-1||kimatu==-1){
                System.out.println("F");
            } 
            else if ((tyukan + kimatu) >= 80) {
                System.out.println("A");
            } else if ((tyukan + kimatu) >= 65) {
                System.out.println("B");
            } else if ((tyukan + kimatu) >= 50||saishi>=50) {
                System.out.println("C");
            } else if ((tyukan + kimatu) >= 30) {
                System.out.println("D");
            } else {
                System.out.println("F");
            }
        }
    }
}