import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<String> lines = new ArrayList<String>(); lines new ArrayList<String>() int in = 0; in 0 while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		} true {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		} String string = sc.nextLine(); string sc.nextLine() sc.nextLine sc if (string.equals("-1 -1 -1")) {
				break;
			} string.equals("-1 -1 -1") string.equals string "-1 -1 -1" {
				break;
			} break; lines.add(string) lines.add lines string in++ in int[] gr = new int[3]; gr new int[3] 3 for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		} int i = 0; int i = 0; i 0 i < in i in i++ i++ i {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		} {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		ArrayList<String> lines = new ArrayList<String>();
		int in = 0;

		while (true) {
			String string = sc.nextLine();

			if (string.equals("-1 -1 -1")) {
				break;
			}
			lines.add(string);
			in++;
		}

		int[] gr = new int[3];

		for (int i = 0; i < in; i++) {
			String[] kari = lines.get(i).split(" ");

			for (int j = 0; j < 3; j++) {
				gr[j] = Integer.parseInt(kari[j]);
			}

			if (gr[0] == -1 || gr[1] == -1) {
				System.out.println("F");
			} else if (gr[0] + gr[1] >= 80) {
				System.out.println("A");
			} else if (gr[0] + gr[1] >= 65) {
				System.out.println("B");
			} else if (gr[0] + gr[1] >= 50
					|| (gr[0] + gr[1] >= 30 && gr[2] >= 50)) {
				System.out.println("C");
			} else if (gr[0] + gr[1] >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}

}