import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();
		
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		}
		System.out.print(str);
		
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();
		
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		}
		System.out.print(str);
		
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();
		
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		}
		System.out.print(str);
		
	} main {
		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();
		
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		}
		System.out.print(str);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder str = new StringBuilder(); str new StringBuilder() while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		} true {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		} int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan if(m == -1 && f == -1 && r == -1) break; m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 break; if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n"); m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 str.append("F\n") str.append str "F\n" if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n"); m+f >= 80 m+f m f 80 str.append("A\n") str.append str "A\n" if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n"); m+f >= 65 m+f m f 65 str.append("B\n") str.append str "B\n" if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n"); m+f >= 50 m+f m f 50 str.append("C\n") str.append str "C\n" if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n"); m+f >= 30 m+f m f 30 {
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			} if(r >= 50) str.append("C\n");
				else str.append("D\n"); r >= 50 r 50 str.append("C\n") str.append str "C\n" str.append("D\n") str.append str "D\n" str.append("F\n") str.append str "F\n" if(m == -1 && f == -1 && r == -1) break; m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 break; System.out.print(str) System.out.print System.out System System.out str String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();
		
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) str.append("F\n"); 
			else if(m+f >= 80) str.append("A\n");
			else if(m+f >= 65) str.append("B\n");
			else if(m+f >= 50) str.append("C\n");
			else if(m+f >= 30){
				if(r >= 50) str.append("C\n");
				else str.append("D\n");
			}
			else str.append("F\n");
			
			if(m == -1 && f == -1 && r == -1) break;
		}
		System.out.print(str);
		
	}
}