import java.util.Scanner;

public class Main {

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    } main {
	    Scanner sc = new Scanner(System.in);

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        } sc.hasNext() sc.hasNext sc {
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = a+b; d a+b a b if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            } (a==-1)&&(b==-1)&&(c==-1) (a==-1)&&(b==-1)&&(c==-1) (a==-1) a -1 1 (b==-1) b -1 1 (c==-1) c -1 1 break; {
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            } if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n"); d>=80 d 80 System.out.print("A\n") System.out.print System.out System System.out "A\n" if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n"); d>=65&&d<80 d>=65 d 65 d<80 d 80 System.out.print("B\n") System.out.print System.out System System.out "B\n" if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n"); (d>=50&&d<65)||c>=50 (d>=50&&d<65) d>=50 d 50 d<65 d 65 c>=50 c 50 System.out.print("C\n") System.out.print System.out System System.out "C\n" if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n"); (d<30)||((a==-1||b==-1)) (d<30) d 30 ((a==-1||b==-1)) a==-1 a -1 1 b==-1 b -1 1 System.out.print("F\n") System.out.print System.out System System.out "F\n" if((d>=30)&&(d<50))
                    System.out.print("D\n"); (d>=30)&&(d<50) (d>=30) d 30 (d<50) d 50 System.out.print("D\n") System.out.print System.out System System.out "D\n" String[] args args public class Main {

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    }
} public class Main {

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    }
} Main
import java.util.Scanner;

public class Main {

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

	    while(sc.hasNext()){
	        int a = sc.nextInt();
	        int b = sc.nextInt();
	        int c = sc.nextInt();
	        int d = a+b;

	        if((a==-1)&&(b==-1)&&(c==-1))
	            break;
            else{
                if(d>=80)
                    System.out.print("A\n");
                else if(d>=65&&d<80)
                    System.out.print("B\n");
                else if((d>=50&&d<65)||c>=50)
                    System.out.print("C\n");
                else if((d<30)||((a==-1||b==-1)))
                    System.out.print("F\n");
                else if((d>=30)&&(d<50))
                    System.out.print("D\n");

            }
        }
    }
}

