
import java.util.Scanner;

class Main {

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        int chukan = sc.nextInt();
        int kimatu = sc.nextInt();
        int saisi = sc.nextInt();
        while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        }
    }

}
 import java.util.Scanner; Scanner java.util class Main {

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        int chukan = sc.nextInt();
        int kimatu = sc.nextInt();
        int saisi = sc.nextInt();
        while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        }
    }

} Main static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    } gcd {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    } if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        } y == 0 y 0 {
            return x;
        } return x; x {
            return gcd(y, x % y);
        } return gcd(y, x % y); gcd(y, x % y) gcd y x % y x y int x x int y y public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        int chukan = sc.nextInt();
        int kimatu = sc.nextInt();
        int saisi = sc.nextInt();
        while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int chukan = sc.nextInt();
        int kimatu = sc.nextInt();
        int saisi = sc.nextInt();
        while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int chukan = sc.nextInt(); chukan sc.nextInt() sc.nextInt sc int kimatu = sc.nextInt(); kimatu sc.nextInt() sc.nextInt sc int saisi = sc.nextInt(); saisi sc.nextInt() sc.nextInt sc while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        } chukan != -1 || kimatu != -1 || saisi != -1 chukan != -1 || kimatu != -1 || saisi != -1 chukan != -1 chukan -1 1 kimatu != -1 kimatu -1 1 saisi != -1 saisi -1 1 {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        } int o = kimatu + chukan; o kimatu + chukan kimatu chukan if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } o < 30 o 30 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } chukan == -1 || kimatu == -1 chukan == -1 chukan -1 1 kimatu == -1 kimatu -1 1 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } 80 <= o 80 o {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } 65 <= o && o < 80 65 <= o 65 o o < 80 o 80 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } 50 <= o && o < 65 50 <= o 50 o o < 65 o 65 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } 30 <= o && o < 50 && saisi >= 50 30 <= o && o < 50 && saisi >= 50 30 <= o 30 o o < 50 o 50 saisi >= 50 saisi 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            } 30 <= o && o < 50 && saisi < 50 30 <= o && o < 50 && saisi < 50 30 <= o 30 o o < 50 o 50 saisi < 50 saisi 50 {
                System.out.println("D");

            } System.out.println("D") System.out.println System.out System System.out "D" chukan = sc.nextInt() chukan sc.nextInt() sc.nextInt sc kimatu = sc.nextInt() kimatu sc.nextInt() sc.nextInt sc saisi = sc.nextInt() saisi sc.nextInt() sc.nextInt sc String args[] args

import java.util.Scanner;

class Main {

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        int chukan = sc.nextInt();
        int kimatu = sc.nextInt();
        int saisi = sc.nextInt();
        while (chukan != -1 || kimatu != -1 || saisi != -1) {
            int o = kimatu + chukan;
            if (o < 30) {
                System.out.println("F");
            } else if (chukan == -1 || kimatu == -1) {
                System.out.println("F");
            } else if (80 <= o) {
                System.out.println("A");
            } else if (65 <= o && o < 80) {
                System.out.println("B");
            } else if (50 <= o && o < 65) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi >= 50) {
                System.out.println("C");
            } else if (30 <= o && o < 50 && saisi < 50) {
                System.out.println("D");

            }
            chukan = sc.nextInt();
            kimatu = sc.nextInt();
            saisi = sc.nextInt();
        }
    }

}

