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

public class Main {

    public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    }

    private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    }

    private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    }
} Main public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    } main {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    } int middleScore = 0; middleScore 0 int finalScore = 0; finalScore 0 int revengeScore = 0; revengeScore 0 try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        } catch (Exception e) {
            System.err.println(e);
        } Exception e {
            System.err.println(e);
        } System.err.println(e) System.err.println System.err System System.err e {

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            } true {
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            } String input = br.readLine(); input br.readLine() br.readLine br String[] strArray = input.split(" "); strArray input.split(" ") input.split input " " middleScore = Integer.parseInt(strArray[0]) middleScore Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 finalScore = Integer.parseInt(strArray[1]) finalScore Integer.parseInt(strArray[1]) Integer.parseInt Integer strArray[1] strArray 1 revengeScore = Integer.parseInt(strArray[2]) revengeScore Integer.parseInt(strArray[2]) Integer.parseInt Integer strArray[2] strArray 2 if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                } middleScore == -1 && finalScore == -1 && revengeScore == -1 middleScore == -1 && finalScore == -1 && revengeScore == -1 middleScore == -1 middleScore -1 1 finalScore == -1 finalScore -1 1 revengeScore == -1 revengeScore -1 1 {
                    break;
                } break; System.out.println(grading(middleScore, finalScore, revengeScore)) System.out.println System.out System System.out grading(middleScore, finalScore, revengeScore) grading middleScore finalScore revengeScore String[] args args private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    } grading {

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    } int sum = middleScore + finalScore; sum middleScore + finalScore middleScore finalScore String grade = null; grade null if(middleScore == -1 || finalScore == -1){
            return "F";
        } middleScore == -1 || finalScore == -1 middleScore == -1 middleScore -1 1 finalScore == -1 finalScore -1 1 {
            return "F";
        } return "F"; "F" if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        } 80 <= sum 80 sum {
            return "A";

        } return "A"; "A" if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        } 65 <= sum 65 sum {
            return "B";

        } return "B"; "B" if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        } 50 <= sum 50 sum {
            return "C";

        } return "C"; "C" if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        } 30 <= sum 30 sum {
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        } if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            } 50 <= revengeScore 50 revengeScore {
                return "C";
            } return "C"; "C" {
                return "D";
            } return "D"; "D" {
            return "F";
        } return "F"; "F" int middleScore middleScore int finalScore finalScore int revengeScore revengeScore public class Main {

    public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    }

    private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    }
} public class Main {

    public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    }

    private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

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

public class Main {

    public static void main(String[] args) throws IOException {

        int middleScore = 0;    //??????????¨?????????°
        int finalScore = 0;     //??????????¨?????????°
        int revengeScore = 0;   //???????¨?????????°

        try{

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){
                String input = br.readLine();
                String[] strArray = input.split(" ");

                middleScore = Integer.parseInt(strArray[0]);
                finalScore = Integer.parseInt(strArray[1]);
                revengeScore = Integer.parseInt(strArray[2]);

//              ??????????????????????????¨???-1?????¨??????????????????
                if(middleScore == -1 && finalScore == -1 && revengeScore == -1){
                    break;
                }

                System.out.println(grading(middleScore, finalScore, revengeScore));
            }
        }catch (Exception e) {
            System.err.println(e);
        }
    }

    private static String grading(int middleScore, int finalScore, int revengeScore){

        int sum = middleScore + finalScore;
        String grade = null;

        if(middleScore == -1 || finalScore == -1){
            return "F";
        }

        if(80 <= sum){
            return "A";

        }else if(65 <= sum){
            return "B";

        }else if(50 <= sum){
            return "C";

        }else if(30 <= sum){
            if(50 <= revengeScore){
                return "C";
            }else{
                return "D";
            }
        }else{
            return "F";
        }

    }
}