import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	}
} import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	} main {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	} while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		} true {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		} int chuu = sc.nextInt(); chuu sc.nextInt() sc.nextInt sc int kima = sc.nextInt(); kima sc.nextInt() sc.nextInt sc int sai = sc.nextInt(); sai sc.nextInt() sc.nextInt sc if (chuu==-1 && kima==-1 && sai==-1) {break;} chuu==-1 && kima==-1 && sai==-1 chuu==-1 && kima==-1 && sai==-1 chuu==-1 chuu -1 1 kima==-1 kima -1 1 sai==-1 sai -1 1 {break;} break; if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");} chuu==-1 || kima==-1 chuu==-1 chuu -1 1 kima==-1 kima -1 1 {System.out.println("F");} System.out.println("F") System.out.println System.out System System.out "F" if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");} chuu+kima >= 80 chuu+kima chuu kima 80 {System.out.println("A");} System.out.println("A") System.out.println System.out System System.out "A" if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");} chuu+kima >= 65 && chuu+kima <80 chuu+kima >= 65 chuu+kima chuu kima 65 chuu+kima <80 chuu+kima chuu kima 80 {System.out.println("B");} System.out.println("B") System.out.println System.out System System.out "B" if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");} chuu+kima >=50 && chuu+kima < 65 chuu+kima >=50 chuu+kima chuu kima 50 chuu+kima < 65 chuu+kima chuu kima 65 {System.out.println("C");} System.out.println("C") System.out.println System.out System System.out "C" if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");} chuu+kima >=30 && chuu+kima <50 chuu+kima >=30 chuu+kima chuu kima 30 chuu+kima <50 chuu+kima chuu kima 50 {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			} if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");} sai >= 50 sai 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 (chuu+kima < 30) {System.out.println("F");} chuu+kima < 30 chuu+kima chuu kima 30 {System.out.println("F");} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	}
} Main
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		while (true) {
			int chuu = sc.nextInt();
			int kima = sc.nextInt();
			int sai = sc.nextInt();
			if (chuu==-1 && kima==-1 && sai==-1) {break;}
			
			if (chuu==-1 || kima==-1) {System.out.println("F");}
			else if (chuu+kima >= 80) {System.out.println("A");}
			else if (chuu+kima >= 65 && chuu+kima <80) {System.out.println("B");}
			else if (chuu+kima >=50 && chuu+kima < 65) {System.out.println("C");}
			else if (chuu+kima >=30 && chuu+kima <50) {
				if (sai >= 50) {System.out.println("C");}
				else {System.out.println("D");}
			}
			else if (chuu+kima < 30) {System.out.println("F");}
		}
	}
}
