import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        } true {
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        } String[] tests=reader.readLine().split(" "); tests reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break; tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1") tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1") tests[0].equals("-1") tests[0].equals tests[0] tests 0 "-1" tests[1].equals("-1") tests[1].equals tests[1] tests 1 "-1" tests[2].equals("-1") tests[2].equals tests[2] tests 2 "-1" break; if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); tests[0].equals("-1")||tests[1].equals("-1") tests[0].equals("-1") tests[0].equals tests[0] tests 0 "-1" tests[1].equals("-1") tests[1].equals tests[1] tests 1 "-1" System.out.println("F") System.out.println System.out System System.out "F" if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80 Integer.parseInt(tests[0])+Integer.parseInt(tests[1]) Integer.parseInt(tests[0]) Integer.parseInt Integer tests[0] tests 0 Integer.parseInt(tests[1]) Integer.parseInt Integer tests[1] tests 1 80 System.out.println("A") System.out.println System.out System System.out "A" if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65 Integer.parseInt(tests[0])+Integer.parseInt(tests[1]) Integer.parseInt(tests[0]) Integer.parseInt Integer tests[0] tests 0 Integer.parseInt(tests[1]) Integer.parseInt Integer tests[1] tests 1 65 System.out.println("B") System.out.println System.out System System.out "B" if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50 Integer.parseInt(tests[0])+Integer.parseInt(tests[1]) Integer.parseInt(tests[0]) Integer.parseInt Integer tests[0] tests 0 Integer.parseInt(tests[1]) Integer.parseInt Integer tests[1] tests 1 50 System.out.println("C") System.out.println System.out System System.out "C" if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30 Integer.parseInt(tests[0])+Integer.parseInt(tests[1]) Integer.parseInt(tests[0]) Integer.parseInt Integer tests[0] tests 0 Integer.parseInt(tests[1]) Integer.parseInt Integer tests[1] tests 1 30 {
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D"); Integer.parseInt(tests[2])>=50 Integer.parseInt(tests[2]) Integer.parseInt Integer tests[2] tests 2 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" if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F"); Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30 Integer.parseInt(tests[0])+Integer.parseInt(tests[1]) Integer.parseInt(tests[0]) Integer.parseInt Integer tests[0] tests 0 Integer.parseInt(tests[1]) Integer.parseInt Integer tests[1] tests 1 30 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) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            String[] tests=reader.readLine().split(" ");
            
            if(tests[0].equals("-1")&&tests[1].equals("-1")&&tests[2].equals("-1")) break;
            
            if(tests[0].equals("-1")||tests[1].equals("-1")) System.out.println("F");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=80) System.out.println("A");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=65) System.out.println("B");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=50) System.out.println("C");
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])>=30){
                if(Integer.parseInt(tests[2])>=50) System.out.println("C");
                else System.out.println("D");
            } 
            else if(Integer.parseInt(tests[0])+Integer.parseInt(tests[1])<30) System.out.println("F");
        }
    }
}