import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	}

}
 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 first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	} main {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		} true {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		} int first = sc.nextInt(); first sc.nextInt() sc.nextInt sc int mid = sc.nextInt(); mid sc.nextInt() sc.nextInt sc int re = sc.nextInt(); re sc.nextInt() sc.nextInt sc String ach; ach if(first == -1 && mid == -1 && re == -1) break; first == -1 && mid == -1 && re == -1 first == -1 && mid == -1 && re == -1 first == -1 first -1 1 mid == -1 mid -1 1 re == -1 re -1 1 break; int sumPoint = first + mid; sumPoint first + mid first mid if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			} first == -1 || mid == -1 || (sumPoint) < 30 first == -1 || mid == -1 || (sumPoint) < 30 first == -1 first -1 1 mid == -1 mid -1 1 (sumPoint) < 30 (sumPoint) 30 {
				ach = "F";
			} ach = "F" ach "F" if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			} (sumPoint) >= 80 (sumPoint) 80 {
				ach = "A";
			} ach = "A" ach "A" if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			} (sumPoint) >= 65 (sumPoint) 65 {
				ach = "B";
			} ach = "B" ach "B" if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			} (sumPoint) >= 50 (sumPoint) 50 {
				ach = "C";
			} ach = "C" ach "C" {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			} if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				} re >= 50 re 50 {
					ach = "C";
				} ach = "C" ach "C" {
					ach = "D";
				} ach = "D" ach "D" System.out.println(ach) System.out.println System.out System System.out ach String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {

			// 入力
			int first = sc.nextInt();
			int mid = sc.nextInt();
			int re = sc.nextInt();

			String ach;

			if(first == -1 && mid == -1 && re == -1) break;

			// 成績判断
			int sumPoint = first + mid;
			if(first == -1 || mid == -1 || (sumPoint) < 30) {
				ach = "F";
			} else if((sumPoint) >= 80) {
				ach = "A";
			} else if((sumPoint) >= 65) {
				ach = "B";
			} else if((sumPoint) >= 50) {
				ach = "C";
			} else {
				if(re >= 50) {
					ach = "C";
				} else {
					ach = "D";
				}
			}

			System.out.println(ach);

		}

	}

}

