import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} Main public static final String EOL = System.getProperty("line.separator"); EOL System.getProperty("line.separator") System.getProperty System "line.separator" public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    } exec {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String[] s; s int m m f f r; r while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	} true {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	} s = br.readLine().split(" ") s br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(s[0]) m Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 f = Integer.parseInt(s[1]) f Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 r = Integer.parseInt(s[2]) r Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 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; if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F"); m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 out.println("F") out.println out "F" if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F"); m + f >= 80 m + f m f 80 out.println("A") out.println out "A" if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F"); m + f >= 65 m + f m f 65 out.println("B") out.println out "B" if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F"); m + f >= 50 m + f m f 50 out.println("C") out.println out "C" if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F"); m + f >= 30 m + f m f 30 out.println(r>=50 ? "C" : "D") out.println out r>=50 ? "C" : "D" r>=50 r 50 "C" "D" out.println("F") out.println out "F" out.flush() out.flush out public static void main(String[] args) throws IOException {
    	new Main().exec();
    } main {
    	new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static final String EOL = System.getProperty("line.separator");
    public void exec() throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	PrintWriter out = new PrintWriter(System.out);
    	String[] s;
    	int m,f,r;
    	while(true) {
    		s = br.readLine().split(" ");
    		m = Integer.parseInt(s[0]);
            f = Integer.parseInt(s[1]);
            r = Integer.parseInt(s[2]);
            if(m == -1 && f == -1 && r == -1)
            	break;
            if(m == -1 || f == -1)
            	out.println("F");
            else if (m + f >= 80)
            	out.println("A");
            else if (m + f >= 65)
            	out.println("B");
            else if (m + f >= 50)
            	out.println("C");
            else if (m + f >= 30)
            	out.println(r>=50 ? "C" : "D");
            else
            	out.println("F");
    	}
        out.flush();
    }
 
    public static void main(String[] args) throws IOException {
    	new Main().exec();
    }
}