import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	}
} Main public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m m f f r r n = 0; n 0 String data[] = new String[50]; data new String[50] 50 while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		} true {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		} m = scan.nextInt() m scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan 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) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				data[n] = "F";
			} data[n] = "F" data[n] data n "F" if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			} m + f >= 80 m + f m f 80 {
				data[n] = "A";
			} data[n] = "A" data[n] data n "A" if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			} m + f >= 65 m + f m f 65 {
				data[n] = "B";
			} data[n] = "B" data[n] data n "B" if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			} m + f >= 50 m + f m f 50 {
				data[n] = "C";
			} data[n] = "C" data[n] data n "C" if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			} m + f >= 30 m + f m f 30 {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			} if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				} r >= 50 r 50 {
					data[n] = "C";
				} data[n] = "C" data[n] data n "C" {
					data[n] = "D";
				} data[n] = "D" data[n] data n "D" {
				data[n] = "F";
			} data[n] = "F" data[n] data n "F" n++ n for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			System.out.println(data[i]);
		} {
			System.out.println(data[i]);
		} System.out.println(data[i]) System.out.println System.out System System.out data[i] data i String [] args args public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	}
} public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int m, f, r, n = 0;
		String data[] = new String[50];
		
		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			
			if( m == -1 && f == -1 && r == -1)break;
			
			if( m == -1 || f == -1) {
				data[n] = "F";
			}else if( m + f >= 80){
				data[n] = "A";
			}else if( m + f >= 65) {
				data[n] = "B";
			}else if( m + f >= 50){
				data[n] = "C";
			}else if( m + f >= 30) {
				if( r >= 50) {
					data[n] = "C";
				}else {
					data[n] = "D";
				}
			}else {
				data[n] = "F";
			}
			
			n++;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.println(data[i]);
		}
	}
} Main
import java.util.Scanner;

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

