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

public class Main{
	public static void main(String args[]){
		try{
				//InputStreamReader??§??????????????????????????????????????????
				InputStreamReader isr =new InputStreamReader(System.in);
				//????????????????????????????????????????????°(????????????????????????????????¨??????????????????????????¢???????????????????£????)
				BufferedReader br =new BufferedReader(isr);

			while(true){
				//1??????????????????????????¨??????????????????
				String buf = br.readLine();
				//?¬¬????????°???????????????????????????????¬¬????????°????????????????????????????????§???????????????????????§???????????????
				StringTokenizer st = new StringTokenizer(buf," ");

				//1????????????????????¨??£???int??????????????????
				int m = Integer.parseInt(st.nextToken());
				int f = Integer.parseInt(st.nextToken());
				int r = Integer.parseInt(st.nextToken());
				int sum = (m + f);
				String result ="";


				//??¨????????????-1?????£????????????
				if(m == -1 && f == -1 && r == -1){
					break;
				//??????????¨??????????????¨????????????????????¬????????????´???????????? F
				}else if(m == -1 || f == -1){
					result += "F";
				//80 ??\???????????°????????? A
				}else if(sum >= 80){
					result += "A";
				//65 ??\??? 80 ??????????????°????????? B
				}else if(sum >= 65 && sum < 80){
					result += "B";
				//50 ??\??? 65 ??????????????°????????? C
				}else if(sum >= 50 && sum < 65){
					result += "C";
				//30 ??\??? 50 ??????????????°????????? D
				}else if(sum >= 30 && sum < 50){
					//???????????????????¨?????????°??? 50 ??\???????????°????????? C
					if(r >= 50){
						result += "C";
					}else{
						result += "D";
					}
				//30 ??????????????°????????? F
				}else if(sum < 30){
					result += "F";
				}
				System.out.println(result);
			}
		}catch(NumberFormatException e){
			System.out.print(e);
		} catch (IOException e) {
			System.out.print(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