import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i;
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        }          
        System.out.flush();
    }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main{
    public static void main(String[] args) throws IOException {
        int i;
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        }          
        System.out.flush();
    }
} Main public static void main(String[] args) throws IOException {
        int i;
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        }          
        System.out.flush();
    } main {
        int i;
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        }          
        System.out.flush();
    } int i; i int[] n = new int[990]; n new int[990] 990 String[] str = new String[990]; str new String[990] 990 BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        } ; {
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        } {
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        } str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            } i=0; i=0 i 0 i<3 i 3 i++ i++ i {
                n[i]=Integer.parseInt(str[i]);
            } {
                n[i]=Integer.parseInt(str[i]);
            } n[i]=Integer.parseInt(str[i]) n[i] n i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i if(n[0]==n[1] && n[0]==-1)   break; n[0]==n[1] && n[0]==-1 n[0]==n[1] n[0] n 0 n[1] n 1 n[0]==-1 n[0] n 0 -1 1 break; if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); (n[0]==-1) || (n[1]==-1) (n[0]==-1) n[0] n 0 -1 1 (n[1]==-1) n[1] n 1 -1 1 System.out.println("F") System.out.println System.out System System.out "F" if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); n[0]+n[1]<30 n[0]+n[1] n[0] n 0 n[1] n 1 30 System.out.println("F") System.out.println System.out System System.out "F" if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); (30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50 (30<=n[0]+n[1] && n[0]+n[1]<50) 30<=n[0]+n[1] 30 n[0]+n[1] n[0] n 0 n[1] n 1 n[0]+n[1]<50 n[0]+n[1] n[0] n 0 n[1] n 1 50 n[2]<50 n[2] n 2 50 System.out.println("D") System.out.println System.out System System.out "D" if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); (30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50 (30<=n[0]+n[1] && n[0]+n[1]<50) 30<=n[0]+n[1] 30 n[0]+n[1] n[0] n 0 n[1] n 1 n[0]+n[1]<50 n[0]+n[1] n[0] n 0 n[1] n 1 50 n[2]>=50 n[2] n 2 50 System.out.println("C") System.out.println System.out System System.out "C" if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); (50<=n[0]+n[1] && n[0]+n[1]<65) 50<=n[0]+n[1] 50 n[0]+n[1] n[0] n 0 n[1] n 1 n[0]+n[1]<65 n[0]+n[1] n[0] n 0 n[1] n 1 65 System.out.println("C") System.out.println System.out System System.out "C" if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A"); (65<=n[0]+n[1]) && (n[0]+n[1]<80) (65<=n[0]+n[1]) 65 n[0]+n[1] n[0] n 0 n[1] n 1 (n[0]+n[1]<80) n[0]+n[1] n[0] n 0 n[1] n 1 80 System.out.println("B") System.out.println System.out System System.out "B" if(80<=n[0]+n[1])   
                System.out.println("A"); 80<=n[0]+n[1] 80 n[0]+n[1] n[0] n 0 n[1] n 1 System.out.println("A") System.out.println System.out System System.out "A" System.out.flush() System.out.flush System.out System System.out String[] args args
import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i;
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for(;;){
            str = in.readLine().split(" ");
            for(i=0;i<3;i++){
                n[i]=Integer.parseInt(str[i]);
            }
            if(n[0]==n[1] && n[0]==-1)   break;
            if((n[0]==-1) || (n[1]==-1)) 
                System.out.println("F");
            else if(n[0]+n[1]<30)        
                System.out.println("F");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]<50)  
                System.out.println("D");
            else if((30<=n[0]+n[1] && n[0]+n[1]<50) && n[2]>=50) 
                System.out.println("C");
            else if((50<=n[0]+n[1] && n[0]+n[1]<65))     
                System.out.println("C");
            else if((65<=n[0]+n[1]) && (n[0]+n[1]<80))   
                System.out.println("B");
            else if(80<=n[0]+n[1])   
                System.out.println("A");  
        }          
        System.out.flush();
    }
}