import java.util.Scanner;

public class Main {
    public static final int F = 0, A = 1, B = 2, C = 3, D = 4;

    public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    }

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

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    public static final int F = 0, A = 1, B = 2, C = 3, D = 4;

    public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    }

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

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    }
} Main public static final int F = 0 F 0 A = 1 A 1 B = 2 B 2 C = 3 C 3 D = 4; D 4 public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    } grade {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    } int sum = m + f; sum m + f m f if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
            return Main.F;
        } return Main.F; Main.F Main Main.F if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        } sum >= 80 sum 80 {
            return Main.A;
        } return Main.A; Main.A Main Main.A if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        } sum >= 65 sum 65 {
            return Main.B;
        } return Main.B; Main.B Main Main.B if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        } sum >= 50 sum 50 {
            return Main.C;
        } return Main.C; Main.C Main Main.C if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        } sum >= 30 sum 30 {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            } r >= 50 r 50 {
                return Main.C;
            } return Main.C; Main.C Main Main.C {
                return Main.D;
            } return Main.D; Main.D Main Main.D {
            return Main.F;
        } return Main.F; Main.F Main Main.F int m m int f f int r r public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Main app = new Main();

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    } main {
        Scanner scan = new Scanner(System.in);
        Main app = new Main();

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) Main app = new Main(); app new Main() while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        } true {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        } int inM inM inF inF inR; inR int result; result inM = Integer.parseInt(scan.next()) inM Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan inF = Integer.parseInt(scan.next()) inF Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan inR = Integer.parseInt(scan.next()) inR Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan if (inM == -1 && inF == -1 && inR == -1) {
                break;
            } inM == -1 && inF == -1 && inR == -1 inM == -1 && inF == -1 && inR == -1 inM == -1 inM -1 1 inF == -1 inF -1 1 inR == -1 inR -1 1 {
                break;
            } break; result = app.grade(inM, inF, inR) result app.grade(inM, inF, inR) app.grade app inM inF inR switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            } result case Main.F: Main.F Main Main.F case Main.F: System.out.println("F") System.out.println System.out System System.out "F" break; case Main.A: Main.A Main Main.A case Main.A: System.out.println("A") System.out.println System.out System System.out "A" break; case Main.B: Main.B Main Main.B case Main.B: System.out.println("B") System.out.println System.out System System.out "B" break; case Main.C: Main.C Main Main.C case Main.C: System.out.println("C") System.out.println System.out System System.out "C" break; case Main.D: Main.D Main Main.D case Main.D: System.out.println("D") System.out.println System.out System System.out "D" break; String[] args args public class Main {
    public static final int F = 0, A = 1, B = 2, C = 3, D = 4;

    public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    }

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

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    }
} public class Main {
    public static final int F = 0, A = 1, B = 2, C = 3, D = 4;

    public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    }

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

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    }
} Main
import java.util.Scanner;

public class Main {
    public static final int F = 0, A = 1, B = 2, C = 3, D = 4;

    public int grade(int m, int f, int r) {
        int sum = m + f;
        if (m == -1 || f == -1) {
            return Main.F;
        } else if (sum >= 80) {
            return Main.A;
        } else if (sum >= 65) {
            return Main.B;
        } else if (sum >= 50) {
            return Main.C;
        } else if (sum >= 30) {
            if (r >= 50) {
                return Main.C;
            } else {
                return Main.D;
            }
        } else {
            return Main.F;
        }
    }

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

        while (true) {
            int inM, inF, inR;
            int result;
            inM = Integer.parseInt(scan.next());
            inF = Integer.parseInt(scan.next());
            inR = Integer.parseInt(scan.next());

            if (inM == -1 && inF == -1 && inR == -1) {
                break;
            }

            result = app.grade(inM, inF, inR);
            switch (result) {
                case Main.F:
                    System.out.println("F");
                    break;
                case Main.A:
                    System.out.println("A");
                    break;
                case Main.B:
                    System.out.println("B");
                    break;
                case Main.C:
                    System.out.println("C");
                    break;
                case Main.D:
                    System.out.println("D");
                    break;
            }
        }

    }
}

