

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[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	}
	
} 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[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	}
	
} Main public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	} main {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		} true {
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		} String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int tyuukan = Integer.parseInt(input[0]); tyuukan Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 int kimatu = Integer.parseInt(input[1]); kimatu Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 int saisiken = Integer.parseInt(input[2]); saisiken Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 int sum = tyuukan + kimatu; sum tyuukan + kimatu tyuukan kimatu if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		} tyuukan == -1 && kimatu == -1 && saisiken == -1 tyuukan == -1 && kimatu == -1 && saisiken == -1 tyuukan == -1 tyuukan -1 1 kimatu == -1 kimatu -1 1 saisiken == -1 saisiken -1 1 {
			break;
		} break; if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		} tyuukan == -1 || kimatu == -1 tyuukan == -1 tyuukan -1 1 kimatu == -1 kimatu -1 1 {
			System.out.println("F");
		} System.out.println("F") System.out.println System.out System System.out "F" 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		} 30<=sum && sum <50 30<=sum 30 sum sum <50 sum 50 {
			if(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		} if(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			} saisiken >= 50 saisiken 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(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		} 30>sum 30 sum {
			System.out.println("F");
		} System.out.println("F") System.out.println System.out System System.out "F" {
			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) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	}
	
} public class Main {
	public static void main(String[] args) throws IOException{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
		
		String[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	}
	
} 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[] input = br.readLine().split(" ");
		
		int tyuukan = Integer.parseInt(input[0]);
		int kimatu = Integer.parseInt(input[1]);
		int saisiken = Integer.parseInt(input[2]);
		int sum = tyuukan + kimatu;
		
		if(tyuukan == -1 && kimatu == -1 && saisiken == -1){
			break;
		}
		if(tyuukan == -1 || kimatu == -1){
			System.out.println("F");
		}else 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(saisiken >= 50){
				System.out.println("C");
			}else{
				System.out.println("D");
			}
		}else if(30>sum){
			System.out.println("F");
		}else{
			System.out.println("F");
		}
		
		}
	}
	
}