import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    }
}        import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    }
} Main public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    } main {
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int i i j j k k x x y y z; z for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        } i=0; i=0 i 0 i++ i++ i {
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        } {
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        } x=sc.nextInt() x sc.nextInt() sc.nextInt sc y=sc.nextInt() y sc.nextInt() sc.nextInt sc z=sc.nextInt() z sc.nextInt() sc.nextInt sc if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } (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)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } (x==-1)||(y==-1) (x==-1) x -1 1 (y==-1) y -1 1 {
                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){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } 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){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } x+y>=65 x+y x y 65 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } x+y>=50 x+y x y 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            } x+y>=30 x+y x y 30 {
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            } if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                } 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" {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int i,j,k,x,y,z;
        for(i=0;;i++){
            x=sc.nextInt();
            y=sc.nextInt();
            z=sc.nextInt();
            if((x==-1)&&(y==-1)&&(z==-1)){
                break;
            }else if((x==-1)||(y==-1)){
                System.out.println("F");
            }else if(x+y>=80){
                System.out.println("A");
            }else if(x+y>=65){
                System.out.println("B");
            }else if(x+y>=50){
                System.out.println("C");
            }else if(x+y>=30){
                if(z>=50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }
    }
}       
