import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        }
        
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=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 mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        }
        
    } main {
        Scanner sc=new Scanner(System.in);
        int mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=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 mid_exam mid_exam final_exam final_exam re_exam; re_exam while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        } true {
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        } mid_exam=sc.nextInt() mid_exam sc.nextInt() sc.nextInt sc final_exam=sc.nextInt() final_exam sc.nextInt() sc.nextInt sc re_exam=sc.nextInt() re_exam sc.nextInt() sc.nextInt sc if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break; mid_exam==-1 && final_exam==-1 && re_exam == -1 mid_exam==-1 && final_exam==-1 && re_exam == -1 mid_exam==-1 mid_exam -1 1 final_exam==-1 final_exam -1 1 re_exam == -1 re_exam -1 1 break; if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F"); mid_exam==-1 || final_exam ==-1 mid_exam==-1 mid_exam -1 1 final_exam ==-1 final_exam -1 1 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F"); mid_exam+final_exam>=80 mid_exam+final_exam mid_exam final_exam 80 {
                 System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F"); mid_exam+final_exam>=65 mid_exam+final_exam mid_exam final_exam 65 {
                 System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F"); mid_exam+final_exam>=50 mid_exam+final_exam mid_exam final_exam 50 {
                 System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F"); mid_exam+final_exam>=30 mid_exam+final_exam mid_exam final_exam 30 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 } if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D"); re_exam>=50 re_exam 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" 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 mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=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 mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        }
        
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int mid_exam,final_exam,re_exam;
        while(true){
            mid_exam=sc.nextInt();
            final_exam=sc.nextInt();
            re_exam=sc.nextInt();
            if(mid_exam==-1 && final_exam==-1 && re_exam == -1) break;
            if(mid_exam==-1 || final_exam ==-1){
                System.out.println("F");
            }
            else if(mid_exam+final_exam>=80){
                 System.out.println("A");
            }
            else if(mid_exam+final_exam>=65){
                 System.out.println("B");
            }
            else if(mid_exam+final_exam>=50){
                 System.out.println("C");
            }
            else if(mid_exam+final_exam>=30 )
                 {
                   if(re_exam>=50) System.out.println("C");  
                  else System.out.println("D");
                 }
            else System.out.println("F");
        }
        
    }
}
