import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

}
/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