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

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    }
} 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 {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        } true {
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        } String[] ar = br.readLine().split(" "); ar br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int x = Integer.parseInt(ar[0]); x Integer.parseInt(ar[0]) Integer.parseInt Integer ar[0] ar 0 int y = Integer.parseInt(ar[1]); y Integer.parseInt(ar[1]) Integer.parseInt Integer ar[1] ar 1 int z = Integer.parseInt(ar[2]); z Integer.parseInt(ar[2]) Integer.parseInt Integer ar[2] ar 2 if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } x == -1 && y == -1 && z == -1 x == -1 && y == -1 && z == -1 x == -1 x -1 1 y == -1 y -1 1 z == -1 z -1 1 {
                break;
            } break; if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } x == -1 || y == -1 || x+y < 30 x == -1 || y == -1 || x+y < 30 x == -1 x -1 1 y == -1 y -1 1 x+y < 30 x+y x y 30 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } x+y >= 80 x+y x y 80 {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } x+y >= 65 && x+y < 80 x+y >= 65 x+y x y 65 x+y < 80 x+y x y 80 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            } x+y >= 50 && x+y < 65 || z >= 50 x+y >= 50 && x+y < 65 x+y >= 50 x+y x y 50 x+y < 65 x+y x y 65 z >= 50 z 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" String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    }
} public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String[] ar = br.readLine().split(" ");
            int x = Integer.parseInt(ar[0]);
            int y = Integer.parseInt(ar[1]);
            int z = Integer.parseInt(ar[2]);
            if(x == -1 && y == -1 && z == -1){
                break;
            }else if(x == -1 || y == -1 || x+y < 30){
                System.out.println("F");
            }else if(x+y >= 80){
                System.out.println("A");
            }else if(x+y >= 65 && x+y < 80){
                System.out.println("B");
            }else if(x+y >= 50 && x+y < 65 || z >= 50){
                System.out.println("C");
            }else{
                System.out.println("D");
            }
        }
    }
}