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

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    }
    
    static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    }
    
    static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    }
} Main public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    } main {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line; line String judge; judge int[] score = new int[3]; score new int[3] 3 while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        } true {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        } line = br.readLine() line br.readLine() br.readLine br String ary[] = line.split(" "); ary line.split(" ") line.split line " " score[0] = Integer.parseInt(ary[0]) score[0] score 0 Integer.parseInt(ary[0]) Integer.parseInt Integer ary[0] ary 0 score[1] = Integer.parseInt(ary[1]) score[1] score 1 Integer.parseInt(ary[1]) Integer.parseInt Integer ary[1] ary 1 score[2] = Integer.parseInt(ary[2]) score[2] score 2 Integer.parseInt(ary[2]) Integer.parseInt Integer ary[2] ary 2 if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            } score[0] == -1 && score[1] == -1 && score[2] == -1 score[0] == -1 && score[1] == -1 && score[2] == -1 score[0] == -1 score[0] score 0 -1 1 score[1] == -1 score[1] score 1 -1 1 score[2] == -1 score[2] score 2 -1 1 {
                break;
            } break; judge = judgeScore(score[0], score[1], score[2]) judge judgeScore(score[0], score[1], score[2]) judgeScore score[0] score 0 score[1] score 1 score[2] score 2 System.out.println(judge) System.out.println System.out System System.out judge String[] args args static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    } judgeScore {
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    } int sum = tyukan + kimatu; sum tyukan + kimatu tyukan kimatu String judge; judge if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        } tyukan == -1 || kimatu == -1 tyukan == -1 tyukan -1 1 kimatu == -1 kimatu -1 1 {
            judge = "F";
        } judge = "F" judge "F" if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        } sum >= 80 sum 80 {
            judge = "A";
        } judge = "A" judge "A" if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        } sum >= 65 sum 65 {
            judge = "B";
        } judge = "B" judge "B" if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        } sum >= 50 sum 50 {
            judge = "C";
        } judge = "C" judge "C" if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        } sum >= 30 sum 30 {
            judge = "D";
        } judge = "D" judge "D" {
            judge = "F";
        } judge = "F" judge "F" if(sai >= 50){
            judge = "C";
        } sai >= 50 sai 50 {
            judge = "C";
        } judge = "C" judge "C" return judge; judge int tyukan tyukan int kimatu kimatu int sai sai public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    }
    
    static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    }
    
    static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line;
        String judge;
        int[] score = new int[3];
        
        while (true) {
            line = br.readLine();
            
            String ary[] = line.split(" ");
            score[0] = Integer.parseInt(ary[0]);
            score[1] = Integer.parseInt(ary[1]);
            score[2] = Integer.parseInt(ary[2]);
            
            if(score[0] == -1 && score[1] == -1 && score[2] == -1){
                break;
            }
            
            judge = judgeScore(score[0], score[1], score[2]);
            
            System.out.println(judge);
        }
        
    }
    
    static String judgeScore(int tyukan, int kimatu, int sai){
        int sum = tyukan + kimatu;
        String judge;
        
        if(tyukan == -1 || kimatu == -1){
            judge = "F";
        }else if(sum >= 80){
            judge = "A";
        }else if(sum >= 65){
            judge = "B";
        }else if(sum >= 50){
            judge = "C";
        }else if(sum >= 30){
            judge = "D";
        }else{
            judge = "F";
        }
        
        if(sai >= 50){
            judge = "C";
        }
        
        return judge;
    }
}