import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		//データ入力の準備
		Scanner sc = new Scanner(System.in);
		
		while(true){
			//データ入力
			int mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						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 mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						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 mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			}
		}
	} main {
		//データ入力の準備
		Scanner sc = new Scanner(System.in);
		
		while(true){
			//データ入力
			int mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true){
			//データ入力
			int mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			}
		} true {
			//データ入力
			int mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			}
		} int mid = sc.nextInt(); mid sc.nextInt() sc.nextInt sc int fin = sc.nextInt(); fin sc.nextInt() sc.nextInt sc int re = sc.nextInt(); re sc.nextInt() sc.nextInt sc if(mid == -1 && fin == -1 && re == -1){
				break;
			} mid == -1 && fin == -1 && re == -1 mid == -1 && fin == -1 && re == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 re == -1 re -1 1 {
				break;
			} break; if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			} mid == -1 || fin == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 {
				System.out.println('F');
			} System.out.println('F') System.out.println System.out System System.out 'F' {
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			} int sum = mid + fin; sum mid + fin mid fin if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				} sum >= 80 sum 80 {
					System.out.println('A');
				} System.out.println('A') System.out.println System.out System System.out 'A' if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				} 65 <= sum && sum < 80 65 <= sum 65 sum sum < 80 sum 80 {
					System.out.println('B');
				} System.out.println('B') System.out.println System.out System System.out 'B' if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				} 50 <= sum && sum < 65 50 <= sum 50 sum sum < 65 sum 65 {
					System.out.println('C');
				} System.out.println('C') System.out.println System.out System System.out 'C' if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				} 30 <= sum && sum < 50 30 <= sum 30 sum sum < 50 sum 50 {
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				} if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					} re >= 50 re 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' {
					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 mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						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 mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						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 mid = sc.nextInt();
			int fin = sc.nextInt();
			int re = sc.nextInt();
			
			//終了条件の判定
			if(mid == -1 && fin == -1 && re == -1){
				break;
			}
			
			//試験を受けたかどうか分岐
			if (mid == -1 || fin == -1){
				System.out.println('F');
			}else{
				//成績の条件分岐
				int sum = mid + fin;
				
				if (sum >= 80){
					System.out.println('A');
				}else if (65 <= sum && sum < 80){
					System.out.println('B');
				}else if (50 <= sum && sum < 65){
					System.out.println('C');
				}else if (30 <= sum && sum < 50){
					if (re >= 50){
						System.out.println('C');
					}else{
						System.out.println('D');
					}
				}else{
					System.out.println('F');
				}
			}
		}
	}
}
