import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public 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[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public 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[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	}
} Main public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		} true {
			String str = br.readLine();
			String[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		} String str = br.readLine(); str br.readLine() br.readLine br String[] s = str.split(" "); s str.split(" ") str.split str " " int shiken1 = Integer.parseInt(s[0]); shiken1 Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int shiken2 = Integer.parseInt(s[1]); shiken2 Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int saishiken = Integer.parseInt(s[2]); saishiken Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 int sum = shiken1 + shiken2; sum shiken1 + shiken2 shiken1 shiken2 if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			} (shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1) (shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1) (shiken1 == -1) shiken1 -1 1 (shiken2 == -1) shiken2 -1 1 (saishiken == -1) saishiken -1 1 {
				break;
			} break; if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			} (shiken1 == -1)||(shiken2 == -1) (shiken1 == -1) shiken1 -1 1 (shiken2 == -1) shiken2 -1 1 {
				System.out.println("F");
				continue;
			} System.out.println("F") System.out.println System.out System System.out "F" continue; if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			} 80 <= sum 80 sum {
				System.out.println("A");
				continue;
			} System.out.println("A") System.out.println System.out System System.out "A" continue; if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			} (65 <= sum)&&(sum <= 79) (65 <= sum) 65 sum (sum <= 79) sum 79 {
				System.out.println("B");
				continue;
			} System.out.println("B") System.out.println System.out System System.out "B" continue; if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			} (50 <= sum)&&(sum <= 64)||(50 <= saishiken) (50 <= sum)&&(sum <= 64) (50 <= sum) 50 sum (sum <= 64) sum 64 (50 <= saishiken) 50 saishiken {
				System.out.println("C");
				continue;
			} System.out.println("C") System.out.println System.out System System.out "C" continue; if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			} (30 <= sum)&&(sum <= 49) (30 <= sum) 30 sum (sum <= 49) sum 49 {
				System.out.println("D");
				continue;
			} System.out.println("D") System.out.println System.out System System.out "D" continue; if(sum <= 29){
				System.out.println("F");
				continue;
			} sum <= 29 sum 29 {
				System.out.println("F");
				continue;
			} System.out.println("F") System.out.println System.out System System.out "F" continue; String[] args args public 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[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	}
} public 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[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public 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[] s = str.split(" ");

			int shiken1 = Integer.parseInt(s[0]);
			int shiken2 = Integer.parseInt(s[1]);
			int saishiken = Integer.parseInt(s[2]);

			int sum = shiken1 + shiken2;

			if((shiken1 == -1)&&(shiken2 == -1)&&(saishiken == -1)){
				break;
			}
			if((shiken1 == -1)||(shiken2 == -1)){
				System.out.println("F");
				continue;
			}else if(80 <= sum){
				System.out.println("A");
				continue;
			}else if((65 <= sum)&&(sum <= 79)){
				System.out.println("B");
				continue;
			}else if((50 <= sum)&&(sum <= 64)||(50 <= saishiken)){
				System.out.println("C");
				continue;
			}else if((30 <= sum)&&(sum <= 49)){
				System.out.println("D");
				continue;
			}else if(sum <= 29){
				System.out.println("F");
				continue;
			}
		}
	}
}