import java.util.*;

public class Main {
    public static final int MAX = 100;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static final int MAX = 100;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    }
} Main public static final int MAX = 100; MAX 100 public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    } main {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        } true {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        } int m = scn.nextInt() m scn.nextInt() scn.nextInt scn f = scn.nextInt() f scn.nextInt() scn.nextInt scn r = scn.nextInt(); r scn.nextInt() scn.nextInt scn if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m < 0 && f < 0 && r < 0 m < 0 && f < 0 && r < 0 m < 0 m 0 f < 0 f 0 r < 0 r 0 {
                break;
            } break; if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m < 0 || f < 0 m < 0 m 0 f < 0 f 0 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m + f > 79 m + f m f 79 {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m + f > 64 m + f m f 64 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m + f > 49 m + f m f 49 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            } m + f > 29 m + f m f 29 {
                System.out.println(r > 49 ? "C" : "D");
            } System.out.println(r > 49 ? "C" : "D") System.out.println System.out System System.out r > 49 ? "C" : "D" r > 49 r 49 "C" "D" {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {
    public static final int MAX = 100;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    }
} public class Main {
    public static final int MAX = 100;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static final int MAX = 100;

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        while(true) {
            int m = scn.nextInt(), f = scn.nextInt(), r = scn.nextInt();
            if(m < 0 && f < 0 && r < 0) {
                break;
            } else if(m < 0 || f < 0) {
                System.out.println("F");
            } else if(m + f > 79) {
                System.out.println("A");
            } else if(m + f > 64) {
                System.out.println("B");
            } else if(m + f > 49) {
                System.out.println("C");
            } else if(m + f > 29) {
                System.out.println(r > 49 ? "C" : "D");
            } else {
                System.out.println("F");
            }
        }
    }
}