import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//		?????????3?¨?????????????????????????
		ArrayList<Integer> mid = new ArrayList<Integer>();
		ArrayList<Integer> fin = new ArrayList<Integer>();
		ArrayList<Integer> re = new ArrayList<Integer>();
		String[] strs = new String[3];
		int[] buf = new int[3];
		while(true)//?????????-1?????\?????????????????§?????????
		{
			strs = br.readLine().split(" ");
			for(int i=0; i<3; i++)	buf[i] = Integer.parseInt(strs[i]);
			if(buf[0]+buf[1]+buf[2]==-3) break;
			mid.add(buf[0]);
			fin.add(buf[1]);
			re.add(buf[2]);
		}
		
		int stu = mid.size();
		int m, f, r, mix;
		for(int i=0; i<stu; i++)
		{
			m = mid.get(i);
			f = fin.get(i);
			r = re.get(i);
			mix = m + f;
//		??????????¨??????????????¨????????????????????¬????????????´???????????? F??? 
			if(m==-1 || f==-1 ||(mix>=0 &&mix<30)) 
			{
				System.out.println("F");
				continue;
			}
//		??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
			else if(mix>=80)
			{
				System.out.println("A");
				continue;
			}
//		??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
			else if(mix>=65&&mix<80)
			{
				System.out.println("B");
				continue;
			}
//		??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
			else if((mix>=50&&mix<65)||(mix>=30&&mix<50&&r>=50))
			{
				System.out.println("C");
				continue;
			}
//		??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D???
			else if(mix>=30&&mix<50&&r<50)
			{
				System.out.println("D");
				continue;
			}
		}	
	}
}
/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