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