import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		}
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 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);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 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) int[] m = new int[100] m new int[100] 100 f = new int[100] f new int[100] 100 r = new int[100]; r new int[100] 100 int sum sum cnt = 0; cnt 0 while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		} true {
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		} m[cnt] = sc.nextInt() m[cnt] m cnt sc.nextInt() sc.nextInt sc f[cnt] = sc.nextInt() f[cnt] f cnt sc.nextInt() sc.nextInt sc r[cnt] = sc.nextInt() r[cnt] r cnt sc.nextInt() sc.nextInt sc if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			} m[cnt] + f[cnt] + r[cnt] == -3 m[cnt] + f[cnt] + r[cnt] m[cnt] + f[cnt] + r[cnt] m[cnt] m cnt f[cnt] f cnt r[cnt] r cnt -3 3 {
				break;
			} break; cnt ++ cnt for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		} int i = 0; int i = 0; i 0 i < cnt i cnt i++ i++ i {
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		} {
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		} if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			} m[i] < 0 || f[i] < 0 m[i] < 0 m[i] m i 0 f[i] < 0 f[i] f i 0 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			} sum = m[i] + f[i] sum m[i] + f[i] m[i] m i f[i] f i 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(r[i] >= 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(r[i] >= 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(r[i] >= 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(r[i] >= 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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				} if(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					} r[i] >= 50 r[i] r i 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);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 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);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		}
	}
} Main
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int[] m = new int[100], f = new int[100], r = new int[100];
		int sum, cnt = 0;
		
		while(true){
			m[cnt] = sc.nextInt();
			f[cnt] = sc.nextInt();
			r[cnt] = sc.nextInt();
			
			if(m[cnt] + f[cnt] + r[cnt] == -3){
				break;
			}
			
			cnt ++;
		}
		
		for(int i = 0; i < cnt; i++){
			if(m[i] < 0 || f[i] < 0){
				System.out.println("F");
			}
			else{
				sum = m[i] + f[i];
				
				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(r[i] >= 50){
						System.out.println("C");
					}
					else{
						System.out.println("D");
					}
				}
				else{
					System.out.println("F");
				}
			}
		}
	}
}