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

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    }
} 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 {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] str; str StringBuilder sb = new StringBuilder(); sb new StringBuilder() int m m f f r; r while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        } true {
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        } str = br.readLine().split(" ") str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(str[0]) m Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 f = Integer.parseInt(str[1]) f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 r = Integer.parseInt(str[2]) r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 if(m == -1 && f == -1 && r == -1) break; m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 break; if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
                sb.append("F\n");
            } sb.append("F\n") sb.append sb "F\n" if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            } m+f >= 80 m+f m f 80 {
                sb.append("A\n");
            } sb.append("A\n") sb.append sb "A\n" if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            } 65 <= m+f && m+f < 80 65 <= m+f 65 m+f m f m+f < 80 m+f m f 80 {
                sb.append("B\n");
            } sb.append("B\n") sb.append sb "B\n" if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            } 50 <= m+f && m+f < 65 50 <= m+f 50 m+f m f m+f < 65 m+f m f 65 {
                sb.append("C\n");
            } sb.append("C\n") sb.append sb "C\n" if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            } 30 <= m+f && m+f < 50 30 <= m+f 30 m+f m f m+f < 50 m+f m f 50 {
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            } if(r >= 50) sb.append("C\n");
                else sb.append("D\n"); r >= 50 r 50 sb.append("C\n") sb.append sb "C\n" sb.append("D\n") sb.append sb "D\n" {
                sb.append("F\n");
            } sb.append("F\n") sb.append sb "F\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str;
        StringBuilder sb = new StringBuilder();
        int m,f,r;
        while(true){
            str = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            if(m == -1 && f == -1 && r == -1) break;
            if(m == -1 || f == -1){
                sb.append("F\n");
            }else if(m+f >= 80){
                sb.append("A\n");
            }else if(65 <= m+f && m+f < 80){
                sb.append("B\n");
            }else if(50 <= m+f && m+f < 65){
                sb.append("C\n");
            }else if(30 <= m+f && m+f < 50){
                if(r >= 50) sb.append("C\n");
                else sb.append("D\n");
            }else{
                sb.append("F\n");
            }
        }
        System.out.print(sb);
    }
}