import java.util.Scanner;
import java.util.function.Function;

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    }

    boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    }

    String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    }
} import java.util.Scanner; Scanner java.util import java.util.function.Function; Function java.util.function public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    }

    boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    }

    String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    } solve {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    } String str; str while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        } true {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        } str = sc.nextLine() str sc.nextLine() sc.nextLine sc String[] sp = str.split(" "); sp str.split(" ") str.split str " " int m = Integer.parseInt(sp[0]); m Integer.parseInt(sp[0]) Integer.parseInt Integer sp[0] sp 0 int f = Integer.parseInt(sp[1]); f Integer.parseInt(sp[1]) Integer.parseInt Integer sp[1] sp 1 int r = Integer.parseInt(sp[2]); r Integer.parseInt(sp[2]) Integer.parseInt Integer sp[2] sp 2 if(isFin(m,f,r))break; isFin(m,f,r) isFin m f r break; System.out.println(judge(m, f, r)) System.out.println System.out System System.out judge(m, f, r) judge m f r boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    } isFin {
        return m == -1 && f == -1 && r == -1;
    } return m == -1 && f == -1 && r == -1; m == -1 && f == -1 && r == -1 m == -1 && f == -1 && r == -1 m == -1 m -1 1 f == -1 f -1 1 r == -1 r -1 1 int m m int f f int r r String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    } judge {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    } int sum = m + f; sum m + f m f if (m == -1 || f == -1 || sum < 30) return "F"; m == -1 || f == -1 || sum < 30 m == -1 || f == -1 || sum < 30 m == -1 m -1 1 f == -1 f -1 1 sum < 30 sum 30 return "F"; "F" if (sum < 50) return r >= 50 ? "C" : "D"; sum < 50 sum 50 return r >= 50 ? "C" : "D"; r >= 50 ? "C" : "D" r >= 50 r 50 "C" "D" if (sum < 65) return "C"; sum < 65 sum 65 return "C"; "C" if (sum < 80) return "B"; sum < 80 sum 80 return "B"; "B" return "A"; "A" int m m int f f int r r public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    }

    boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    }

    String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    }
} public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    }

    boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    }

    String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    }
} Main
import java.util.Scanner;
import java.util.function.Function;

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    Scanner sc = new Scanner(System.in);

    void solve() {
        String str;
        while (true) {
            str = sc.nextLine();
            String[] sp = str.split(" ");
            int m = Integer.parseInt(sp[0]);
            int f = Integer.parseInt(sp[1]);
            int r = Integer.parseInt(sp[2]);
            if(isFin(m,f,r))break;
            System.out.println(judge(m, f, r));
        }
    }

    boolean isFin(int m, int f, int r) {
        return m == -1 && f == -1 && r == -1;
    }

    String judge(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1 || sum < 30) return "F";
        if (sum < 50) return r >= 50 ? "C" : "D";
        if (sum < 65) return "C";
        if (sum < 80) return "B";
        return "A";
    }
}
