import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main{

    static StringBuilder sb;

    public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util public class Main{

    static StringBuilder sb;

    public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    }
} Main static StringBuilder sb; sb public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    } main {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    } try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} Exception e {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	} System.out.println(e.getMessage()) System.out.println System.out System System.out e.getMessage() e.getMessage e System.out.println(Arrays.toString(e.getStackTrace())) System.out.println System.out System System.out Arrays.toString(e.getStackTrace()) Arrays.toString Arrays e.getStackTrace() e.getStackTrace e System.exit(0) System.exit System 0 {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) List<String> lines = new ArrayList<String>(); lines new ArrayList<String>() String line = ""; line "" while((line = br.readLine()) != null){
	    	lines.add(line);
	    } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
	    	lines.add(line);
	    } lines.add(line) lines.add lines line br.close() br.close br for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    } int i = 0; int i = 0; i 0 i < lines.size() i lines.size() lines.size lines i++ i++ i {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    } {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    } Integer m = Integer.parseInt(lines.get(i).split(" ")[0]); m Integer.parseInt(lines.get(i).split(" ")[0]) Integer.parseInt Integer lines.get(i).split(" ")[0] lines.get(i).split(" ") lines.get(i).split lines.get(i) lines.get lines i " " 0 Integer f = Integer.parseInt(lines.get(i).split(" ")[1]); f Integer.parseInt(lines.get(i).split(" ")[1]) Integer.parseInt Integer lines.get(i).split(" ")[1] lines.get(i).split(" ") lines.get(i).split lines.get(i) lines.get lines i " " 1 Integer r = Integer.parseInt(lines.get(i).split(" ")[2]); r Integer.parseInt(lines.get(i).split(" ")[2]) Integer.parseInt Integer lines.get(i).split(" ")[2] lines.get(i).split(" ") lines.get(i).split lines.get(i) lines.get lines i " " 2 if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		} 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 {
		    System.exit(0);
		} System.exit(0) System.exit System 0 if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && 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 (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && 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 (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		} 65 <= m+f && m+f < 80 65 <= m+f 65 m+f m f m+f < 80 m+f m f 80 {
		    System.out.println("B");
		} System.out.println("B") System.out.println System.out System System.out "B" if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		} 50 <= m+f && m+f < 65 50 <= m+f 50 m+f m f m+f < 65 m+f m f 65 {
		    System.out.println("C");
		} System.out.println("C") System.out.println System.out System System.out "C" if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		} 30 <= m+f && m+f < 50 30 <= m+f 30 m+f m f m+f < 50 m+f m f 50 {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    } r != -1 && r >= 50 r != -1 r -1 1 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" System.exit(0) System.exit System 0 String[] args args public class Main{

    static StringBuilder sb;

    public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    }
} public class Main{

    static StringBuilder sb;

    public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main{

    static StringBuilder sb;

    public static void main(String[] args) {
	try {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    List<String> lines = new ArrayList<String>();
	    String line = "";

	    while((line = br.readLine()) != null){
	    	lines.add(line);
	    }
	    br.close();

	    //lines.add("40 42 -1");
	    //lines.add("20 30 -1");
	    //lines.add("0 2 -1");
	    //lines.add("-1 -1 -1");

	    for (int i = 0; i < lines.size(); i++) {
		Integer m = Integer.parseInt(lines.get(i).split(" ")[0]);
		Integer f = Integer.parseInt(lines.get(i).split(" ")[1]);
		Integer r = Integer.parseInt(lines.get(i).split(" ")[2]);

		if (m == -1 && f == -1 && r == -1) {
		    System.exit(0);
		} else if (m == -1 || f == -1) {
		    System.out.println("F");
		} else if (m+f >= 80) {
		    System.out.println("A");
		} else if (65 <= m+f && m+f < 80) {
		    System.out.println("B");
		} else if (50 <= m+f && m+f < 65) {
		    System.out.println("C");
		} else if (30 <= m+f && m+f < 50) {
		    if (r != -1 && r >= 50) {
			System.out.println("C");
		    } else {
			System.out.println("D");
		    }
		} else {
		    System.out.println("F");
		}
	    }

	    System.exit(0);

	} catch (Exception e) {
	    System.out.println(e.getMessage());
	    System.out.println(Arrays.toString(e.getStackTrace()));
	    System.exit(0);
	}
    }
}