import java.io.*;
public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	}
} import java.io.*; io.* java public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	}
} Main /**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		} true {
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		} String input = br.readLine(); input br.readLine() br.readLine br String[] score = input.split(" "); score input.split(" ") input.split input " " Integer m = Integer.parseInt(score[0]); m Integer.parseInt(score[0]) Integer.parseInt Integer score[0] score 0 Integer f = Integer.parseInt(score[1]); f Integer.parseInt(score[1]) Integer.parseInt Integer score[1] score 1 Integer r = Integer.parseInt(score[2]); r Integer.parseInt(score[2]) Integer.parseInt Integer score[2] score 2 Integer total = m + f; total m + f m f 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; if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				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(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			} total >= 80 total 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			} total >= 65 && total < 80 total >= 65 total 65 total < 80 total 80 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			} total >= 50 && total < 65 total >= 50 total 50 total < 65 total 65 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			} total >= 30 && total < 50 total >= 30 total 30 total < 50 total 50 {
				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" if(total < 30){
				System.out.println("F");
			} total < 30 total 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	}
} public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	}
} Main
import java.io.*;
public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String input = br.readLine();
			String[] score = input.split(" ");
			Integer m = Integer.parseInt(score[0]);
			Integer f = Integer.parseInt(score[1]);
			Integer r = Integer.parseInt(score[2]);
			Integer total = m + f;
			if(m == -1 && f == -1 && r == -1){
				break;
			}
			if(m == -1 || f == -1){
				System.out.println("F");
			}
			else if(total >= 80){
				System.out.println("A");
			}
			else if(total >= 65 && total < 80){
				System.out.println("B");
			}
			else if(total >= 50 && total < 65){
				System.out.println("C");
			}
			else if(total >= 30 && total < 50){
				if(r >= 50){
					System.out.println("C");
				}
				else{
					System.out.println("D");
				}
			}
			else if(total < 30){
				System.out.println("F");
			}
		}
	}
}