import java.io.*;
class Main {
	public static void main(String[] args) throws IOException {
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	}
    	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws IOException {
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	}
    	}
} Main public static void main(String[] args) throws IOException {
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	}
    	} main {
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	}
    	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	} true {
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	} String str = br.readLine(); str br.readLine() br.readLine br String[] str2 = str.split(" "); str2 str.split(" ") str.split str " " int a = Integer.parseInt(str2[0]); a Integer.parseInt(str2[0]) Integer.parseInt Integer str2[0] str2 0 int b = Integer.parseInt(str2[1]); b Integer.parseInt(str2[1]) Integer.parseInt Integer str2[1] str2 1 int c = Integer.parseInt(str2[2]); c Integer.parseInt(str2[2]) Integer.parseInt Integer str2[2] str2 2 int x = a + b; x a + b a b if(a == -1 && b == -1 && c == -1){
				break;
            		} a == -1 && b == -1 && c == -1 a == -1 && b == -1 && c == -1 a == -1 a -1 1 b == -1 b -1 1 c == -1 c -1 1 {
				break;
            		} break; if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		} a == -1 || b == -1 a == -1 a -1 1 b == -1 b -1 1 {
                		System.out.println("F");
            		} System.out.println("F") System.out.println System.out System System.out "F" if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		} x >= 80 x 80 {
                		System.out.println("A");
            		} System.out.println("A") System.out.println System.out System System.out "A" if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		} x >= 65 && x < 80 x >= 65 x 65 x < 80 x 80 {
                		System.out.println("B");
           		} System.out.println("B") System.out.println System.out System System.out "B" if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		} x >= 50 && x < 65 x >= 50 x 50 x < 65 x 65 {
                		System.out.println("C");
            		} System.out.println("C") System.out.println System.out System System.out "C" if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		} x >= 30 && x < 50 x >= 30 x 30 x < 50 x 50 {
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		} if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		} c >= 50 c 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" if(x < 30){
                		System.out.println("F");
            		} x < 30 x 30 {
                		System.out.println("F");
            		} System.out.println("F") System.out.println System.out System System.out "F" String[] args args
import java.io.*;
class Main {
	public static void main(String[] args) throws IOException {
        	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	while(true){
			String str = br.readLine();
            		String[] str2 = str.split(" ");
		        int a = Integer.parseInt(str2[0]);
		        int b = Integer.parseInt(str2[1]);
		        int c = Integer.parseInt(str2[2]);
		        int x = a + b;
		        if(a == -1 && b == -1 && c == -1){
				break;
            		}
            		if(a == -1 || b == -1){
                		System.out.println("F");
            		}
            		else if(x >= 80){
                		System.out.println("A");
            		}
            		else if(x >= 65 && x < 80){
                		System.out.println("B");
           		}
            		else if(x >= 50 && x < 65){
                		System.out.println("C");
            		}
            		else if(x >= 30 && x < 50){
                		if(c >= 50){
                    			System.out.println("C");
                		}else{
                    			System.out.println("D");
                		}
            		}else if(x < 30){
                		System.out.println("F");
            		}
        	}
    	}
}