import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    }
} import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line; line while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        } String[] input = line.split(" "); input line.split(" ") line.split line " " if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            } input[0].equals("-1") && input[1].equals("-1") input[0].equals("-1") input[0].equals input[0] input 0 "-1" input[1].equals("-1") input[1].equals input[1] input 1 "-1" {
                break;
            } break; if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            } input[0].equals("-1") || input[1].equals("-1") input[0].equals("-1") input[0].equals input[0] input 0 "-1" input[1].equals("-1") input[1].equals input[1] input 1 "-1" {
                System.out.println("F");
                continue;
            } System.out.println("F") System.out.println System.out System System.out "F" continue; int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]); score Integer.parseInt(input[0]) + Integer.parseInt(input[1]) Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            } score < 30 score 30 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            } score >= 80 score 80 {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            } score < 50 score 50 {
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            } if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D"); Integer.parseInt(input[2]) >= 50 Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            } score < 65 score 65 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" String[] args args public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    }
} public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    }
} Main
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;

        while((line = br.readLine()) != null){
            String[] input = line.split(" ");
            
            if(input[0].equals("-1") && input[1].equals("-1")){
                break;
            }
            
            if(input[0].equals("-1") || input[1].equals("-1")){
                System.out.println("F");
                continue;
            }

            int score = Integer.parseInt(input[0]) + Integer.parseInt(input[1]);

            if(score < 30){
                System.out.println("F");
            }else if(score >= 80){
                System.out.println("A");
            }else if(score < 50){
                if(Integer.parseInt(input[2]) >= 50) System.out.println("C");
                else System.out.println("D");
            }else if(score < 65){
                System.out.println("C");
            }else{
                System.out.println("B");
            }

        }

    }
}