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

public class Main {

	public static void main(String[] args) {

		int[] NumList = new int[3];

		int Result = 0;


		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			while (true) {
				//??\??????????????????
				String line = br.readLine();

				if (line != null) {
					//???????????????????????????
					String[] InputList = line.split(" ", 0);

					//?????????????????´??°???Int???
					for (int i = 0; i < InputList.length; i++) {
						NumList[i] = Integer.parseInt(InputList[i]);
					}

					//????????????????????§??????
					if(!Arrays.asList(NumList[0]).contains(-1) || !Arrays.asList(NumList[1]).contains(-1)){

						//???????????£??\
						Result = NumList[0] + NumList[1];

						//????¨?????????????????????????
						if (!Arrays.asList(NumList[0]).contains(-1) && !Arrays.asList(NumList[1]).contains(-1)) {

							//??????A????????¶
							if(Result >= 80){
								System.out.println("A");
							}
							//??????B????????¶
							else if (Result >= 65) {
								System.out.println("B");
							}
							//??????C????????¶
							else if (Result >= 50) {
								System.out.println("C");
							}
							//??????D????????¶
							else if (Result >= 30) {
								if (NumList[2] >= 50) {
									System.out.println("C");
								}else {
									System.out.println("D");
								}
							}
							else {
								System.out.println("F");
							}
						}
						else{
							System.out.println("F");
						}
					}else{
						break;
					}
				}else {
					break;
				}
			}

		}catch (NumberFormatException e) {
			System.out.println(e);
		}catch (IOException e) {
			System.out.println(e);
		}


	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz