import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main{

    public static void main(String[] args) throws IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main{

    public static void main(String[] args) throws IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    }

} Main public static void main(String[] args) throws IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    } main {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    } ArrayList<Integer> m_list = new ArrayList<>(); m_list new ArrayList<>() ArrayList<Integer> f_list = new ArrayList<>(); f_list new ArrayList<>() ArrayList<Integer> r_list = new ArrayList<>(); r_list new ArrayList<>() int m; m int f; f int r; r BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        } true {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        } String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(line[0]) m Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 f = Integer.parseInt(line[1]) f Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 r = Integer.parseInt(line[2]) r Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 if (m == -1 && f == -1 && r == -1) {
                break;
            } 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 {
                break;
            } break; m_list.add(m) m_list.add m_list m f_list.add(f) f_list.add f_list f r_list.add(r) r_list.add r_list r for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        } int i = 0; int i = 0; i 0 i < m_list.size() i m_list.size() m_list.size m_list i++ i++ i {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        } {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        } if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            } m_list.get(i) == -1 || f_list.get(i) == -1 m_list.get(i) == -1 m_list.get(i) m_list.get m_list i -1 1 f_list.get(i) == -1 f_list.get(i) f_list.get f_list i -1 1 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            } if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A"); m_list.get(i) + f_list.get(i) >= 80 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i 80 System.out.println("A") System.out.println System.out System System.out "A" if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B"); 65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80 65 <= m_list.get(i) + f_list.get(i) 65 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i m_list.get(i) + f_list.get(i) < 80 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i 80 System.out.println("B") System.out.println System.out System System.out "B" if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C"); 50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65 50 <= m_list.get(i) + f_list.get(i) 50 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i m_list.get(i) + f_list.get(i) < 65 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i 65 System.out.println("C") System.out.println System.out System System.out "C" if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                } 30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50 30 <= m_list.get(i) + f_list.get(i) 30 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i m_list.get(i) + f_list.get(i) < 50 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i 50 {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                } if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); } r_list.get(i) >= 50 r_list.get(i) r_list.get r_list i 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" if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F"); m_list.get(i) + f_list.get(i) < 30 m_list.get(i) + f_list.get(i) m_list.get(i) m_list.get m_list i f_list.get(i) f_list.get f_list i 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 IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    }

} public class Main{

    public static void main(String[] args) throws IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main{

    public static void main(String[] args) throws IOException {

        ArrayList<Integer> m_list = new ArrayList<>();
        ArrayList<Integer> f_list = new ArrayList<>();
        ArrayList<Integer> r_list = new ArrayList<>();

        int m;
        int f;
        int r;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] line = br.readLine().split(" ");
            m = Integer.parseInt(line[0]);
            f = Integer.parseInt(line[1]);
            r = Integer.parseInt(line[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }

            m_list.add(m);
            f_list.add(f);
            r_list.add(r);

        }

        for (int i = 0; i < m_list.size(); i++) {
            
            if(m_list.get(i) == -1 || f_list.get(i) == -1){
                System.out.println("F");
            }
            else {
                
                if(m_list.get(i) + f_list.get(i) >= 80) System.out.println("A");
                
                if(65 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 80) System.out.println("B");
                
                if(50 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 65) System.out.println("C");
                
                if(30 <= m_list.get(i) + f_list.get(i) && 
                        m_list.get(i) + f_list.get(i) < 50) {
                    
                    if(r_list.get(i) >= 50) { System.out.println("C"); }
                    else { System.out.println("D"); }
                    
                }
                
                if(m_list.get(i) + f_list.get(i) < 30) System.out.println("F");
                
            }
            
        }
        

    }

}