import java.util.Scanner;

public class Main {

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

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main {

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

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		} true {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		} int chukan = sc.nextInt(); chukan sc.nextInt() sc.nextInt sc int kimatsu = sc.nextInt(); kimatsu sc.nextInt() sc.nextInt sc int saishi = sc.nextInt(); saishi sc.nextInt() sc.nextInt sc if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			} chukan == -1 && kimatsu == -1 && saishi == -1 chukan == -1 && kimatsu == -1 && saishi == -1 chukan == -1 chukan -1 1 kimatsu == -1 kimatsu -1 1 saishi == -1 saishi -1 1 {
				break;
			} break; if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan == -1 || kimatsu == -1 chukan == -1 chukan -1 1 kimatsu == -1 kimatsu -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan + kimatsu >= 80 chukan + kimatsu chukan kimatsu 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan + kimatsu >= 65 chukan + kimatsu chukan kimatsu 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan + kimatsu >= 50 chukan + kimatsu chukan kimatsu 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan + kimatsu >= 30 && saishi >= 50 chukan + kimatsu >= 30 chukan + kimatsu chukan kimatsu 30 saishi >= 50 saishi 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			} chukan + kimatsu >= 30 chukan + kimatsu chukan kimatsu 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) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}
} public class Main {

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

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

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

		while(true) {
			int chukan = sc.nextInt();
			int kimatsu = sc.nextInt();
			int saishi = sc.nextInt();

			if(chukan == -1 && kimatsu == -1 && saishi == -1) {
				break;
			}

			if (chukan == -1 || kimatsu == -1) {
				System.out.println("F");
			} else if(chukan + kimatsu >= 80) {
				System.out.println("A");
			} else if(chukan + kimatsu >= 65) {
				System.out.println("B");
			} else if(chukan + kimatsu >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30 && saishi >= 50) {
				System.out.println("C");
			} else if(chukan + kimatsu >= 30) {
				System.out.println("D");
			} else {
				System.out.println("F");
			}
		}
	}
}

