/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author otsuhata
 */
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    }    

    public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    }
    
     public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    
    public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    }    
} import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    }    

    public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    }
    
     public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    
    public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    }    
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        } int i = 0; int i = 0; i 0 i < 3000 i 3000 i ++ i ++ i {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        } {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        } int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            } printJudge(m,f,r) printJudge m f r {
                printGrade(m,f,r);
            } printGrade(m,f,r) printGrade m f r {
                //System.out.println("##### GAME OVER #####");
                break;
            } break; String[] args args public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    } printGrade { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    } if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
            System.out.println("F");
        } System.out.println("F") System.out.println System.out System System.out "F" if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        } (m + f) >= 80 (m + f) m f 80 {
            System.out.println("A");
        } System.out.println("A") System.out.println System.out System System.out "A" if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        } (m + f) >= 65 (m + f) m f 65 {
            System.out.println("B");
        } System.out.println("B") System.out.println System.out System System.out "B" if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        } (m + f) >= 50 (m + f) m f 50 {
            System.out.println("C");
        } System.out.println("C") System.out.println System.out System System.out "C" if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        } (m + f) >= 30 (m + f) m f 30 {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        } if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            } r >= 50 r 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" int m m int f f int r r public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    } printUpBtm {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    } for(int i = 0; i < W; i++) {
		System.out.print("#");                
	} int i = 0; int i = 0; i 0 i < W i W i++ i++ i {
		System.out.print("#");                
	} {
		System.out.print("#");                
	} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n" int W W public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    } printJudge {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    } if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        } (50 < m ||  50 < f || 100 < r) 50 < m ||  50 < f || 100 < r 50 < m 50 m 50 < f 50 f 100 < r 100 r {
            return false;
        } return false; false if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        } m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 {
            return false;
        } return false; false {
            return true;
        } return true; true int m m int f f int r r public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    }    

    public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    }
    
     public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    
    public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    }    
} public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    }    

    public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    }
    
     public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    
    public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    }    
} Main
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author otsuhata
 */
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        //System.out.println("???H * ?¨?W ?????§???????????????????????????????????°????????§??????");
        //System.out.println("H??¨W?????????3??????300?????????????????\????????????????????????");
        
        for(int i = 0; i < 3000; i ++) {
            //System.out.print("??????????§????????????????????????§??\?????????????????????(0 0??§???????????????):");
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            
            if(printJudge(m,f,r)) {
                printGrade(m,f,r);
            }else {
                //System.out.println("##### GAME OVER #####");
                break;
            }            
            //printUpBtm(W);
            
            //System.out.print("\n");
        }
    }    

    public static void printGrade(int m, int f, int r) { 
        if(m == -1 || f == -1) {
            System.out.println("F");
        }else if((m + f) >= 80) {
            System.out.println("A");
        }else if((m + f) >= 65) {
            System.out.println("B");
        }else if((m + f) >= 50) {
            System.out.println("C");
        }else if((m + f) >= 30) {
            if(r >= 50) {
                System.out.println("C");
            }else {
                System.out.println("D");
            }            
        }else {
            System.out.println("F");
        }           
    }
    
     public static void printUpBtm(int W) {  
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    
    public static boolean printJudge(int m, int f, int r) {
        if((50 < m ||  50 < f || 100 < r)) {
            return false;
        }else if(m == -1 && f == -1 && r == -1) {
            return false;
        }else {
            return true;
        }
    }    
}