import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    } main {
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int m m f f r r sub; sub for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        } int i = 0; int i = 0; i 0 i < 50 i 50 i++ i++ i {
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        } {
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        } m = scanner.nextInt() m scanner.nextInt() scanner.nextInt scanner f = scanner.nextInt() f scanner.nextInt() scanner.nextInt scanner r = scanner.nextInt() r scanner.nextInt() scanner.nextInt scanner if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            } 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;
            } break; if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" {
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            } sub = m + f sub m + f m f if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                } sub >= 80 sub 80 {
                    System.out.println("A");
                } System.out.println("A") System.out.println System.out System System.out "A" if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                } sub >= 65 sub 65 {
                    System.out.println("B");
                } System.out.println("B") System.out.println System.out System System.out "B" if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                } sub >= 50 sub 50 {
                    System.out.println("C");
                } System.out.println("C") System.out.println System.out System System.out "C" if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                } sub >= 30 sub 30 {
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                } if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    } r >= 50 r 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" {
                    System.out.println("F");
                } System.out.println("F") System.out.println System.out System System.out "F" scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int m, f, r, sub;
        for(int i = 0; i < 50; i++){
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();

            if(m == -1 && f == -1 && r == -1){
                break;
            }else if(m == -1 || f == -1){
                System.out.println("F");
            }else{
                sub = m + f;
                if(sub >= 80){
                    System.out.println("A");
                }else if(sub >= 65){
                    System.out.println("B");
                }else if(sub >= 50){
                    System.out.println("C");
                }else if(sub >= 30){
                    if(r >= 50){
                        System.out.println("C");
                    }else{
                        System.out.println("D");
                    }
                }else{
                    System.out.println("F");
                }
            }
        }
        scanner.close();
    }
}

