import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int m, f, r;
        while((m = load()) >= 0 | (f = load()) >= 0 | (r = load()) >= 0) {
            System.out.println(judge(m, f, r));
        }
    }
    
    private static int load() {
        return scn.nextInt();
    }
    
    private static String judge(int m, int f, int r) {
        String rslt;
        int sum;
        if(m < 0 || f < 0 || (sum = m + f) < 30) {
            rslt = "F";
        } else if(sum > 79) {
            rslt = "A";
        } else if(sum > 64) {
            rslt = "B";
        } else if(sum > 49 || r > 49) {
            rslt = "C";
        } else {
            rslt = "D";
        }
        return rslt;
    }
}
/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