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

class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		final int test_num = 3;
		int[] score = new int[test_num];

		while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		}

		System.out.print(sb);

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		final int test_num = 3;
		int[] score = new int[test_num];

		while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		}

		System.out.print(sb);

	}
} Main public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		final int test_num = 3;
		int[] score = new int[test_num];

		while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		}

		System.out.print(sb);

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		final int test_num = 3;
		int[] score = new int[test_num];

		while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		}

		System.out.print(sb);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() final int test_num = 3; test_num 3 int[] score = new int[test_num]; score new int[test_num] test_num while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		} true {

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		} String[] token = br.readLine().split(" "); token br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			} int i = 0; int i = 0; i 0 i < test_num i test_num i++ i++ i {
				score[i] = Integer.parseInt(token[i]);
			} {
				score[i] = Integer.parseInt(token[i]);
			} score[i] = Integer.parseInt(token[i]) score[i] score i Integer.parseInt(token[i]) Integer.parseInt Integer token[i] token i int total_score = score[0] + score[1]; total_score score[0] + score[1] score[0] score 0 score[1] score 1 if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			} score[0] == -1 && score[1] == -1 && score[2] == -1 score[0] == -1 && score[1] == -1 && score[2] == -1 score[0] == -1 score[0] score 0 -1 1 score[1] == -1 score[1] score 1 -1 1 score[2] == -1 score[2] score 2 -1 1 {
				break;
			} break; if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			} score[0] == -1 || score[1] == -1 || total_score < 30 score[0] == -1 || score[1] == -1 || total_score < 30 score[0] == -1 score[0] score 0 -1 1 score[1] == -1 score[1] score 1 -1 1 total_score < 30 total_score 30 {
				sb.append("F");
			} sb.append("F") sb.append sb "F" if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			} total_score >= 30 && total_score < 50 total_score >= 30 total_score 30 total_score < 50 total_score 50 {

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			} if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				} score[2] < 50 score[2] score 2 50 {
					sb.append("D");
				} sb.append("D") sb.append sb "D" {
					sb.append("C");
				} sb.append("C") sb.append sb "C" if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			} total_score >= 50 && total_score < 65 total_score >= 50 total_score 50 total_score < 65 total_score 65 {
				sb.append("C");
			} sb.append("C") sb.append sb "C" if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			} total_score >=65 && total_score < 80 total_score >=65 total_score 65 total_score < 80 total_score 80 {
				sb.append("B");
			} sb.append("B") sb.append sb "B" if(total_score >= 80){
				sb.append("A");
			} total_score >= 80 total_score 80 {
				sb.append("A");
			} sb.append("A") sb.append sb "A" sb.append("\n") sb.append sb "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		final int test_num = 3;
		int[] score = new int[test_num];

		while(true){

			String[] token = br.readLine().split(" ");

			for(int i = 0; i < test_num; i++){
				score[i] = Integer.parseInt(token[i]);
			}

			int total_score = score[0] + score[1];

			if(score[0] == -1 && score[1] == -1 && score[2] == -1){
				break;
			}

			if(score[0] == -1 || score[1] == -1 || total_score < 30){
				sb.append("F");
			}else if(total_score >= 30 && total_score < 50){

				if(score[2] < 50){
					sb.append("D");
				}else{
					sb.append("C");
				}

			}else if(total_score >= 50 && total_score < 65){
				sb.append("C");
			}else if(total_score >=65 && total_score < 80){
				sb.append("B");
			}else if(total_score >= 80){
				sb.append("A");
			}

			sb.append("\n");

		}

		System.out.print(sb);

	}
}