
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int r = scanner.nextInt(); r scanner.nextInt() scanner.nextInt scanner while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        } 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 {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        } if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            } m == -1 || f == -1 || (m + f) < 30 m == -1 || f == -1 || (m + f) < 30 m == -1 m -1 1 f == -1 f -1 1 (m + f) < 30 (m + f) m f 30 {
                System.out.println("F");
            } System.out.println("F") System.out.println System.out System System.out "F" if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            } 30 <= (m + f) && (m + f) < 50 && r < 50 30 <= (m + f) && (m + f) < 50 && r < 50 30 <= (m + f) 30 (m + f) m f (m + f) < 50 (m + f) m f 50 r < 50 r 50 {
                System.out.println("D");
            } System.out.println("D") System.out.println System.out System System.out "D" if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            } 50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50 50 <= (m + f) && (m + f) < 65 50 <= (m + f) 50 (m + f) m f (m + f) < 65 (m + f) m f 65 30 <= (m + f) && (m + f) < 50 && r >= 50 30 <= (m + f) && (m + f) < 50 && r >= 50 30 <= (m + f) 30 (m + f) m f (m + f) < 50 (m + f) m f 50 r >= 50 r 50 {
                System.out.println("C");
            } System.out.println("C") System.out.println System.out System System.out "C" if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            } 65 <= (m + f) && (m + f) < 80 65 <= (m + f) 65 (m + f) m f (m + f) < 80 (m + f) m f 80 {
                System.out.println("B");
            } System.out.println("B") System.out.println System.out System System.out "B" {
                System.out.println("A");
            } System.out.println("A") System.out.println System.out System System.out "A" m = scanner.nextInt() m scanner.nextInt() scanner.nextInt scanner f = scanner.nextInt() f scanner.nextInt() scanner.nextInt scanner r = scanner.nextInt() r scanner.nextInt() scanner.nextInt scanner String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int f = scanner.nextInt();
        int r = scanner.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            if (m == -1 || f == -1 || (m + f) < 30) {
                System.out.println("F");
            } else if (30 <= (m + f) && (m + f) < 50 && r < 50) {
                System.out.println("D");
            } else if (50 <= (m + f) && (m + f) < 65 || 30 <= (m + f) && (m + f) < 50 && r >= 50) {
                System.out.println("C");
            } else if (65 <= (m + f) && (m + f) < 80) {
                System.out.println("B");
            } else {
                System.out.println("A");
            }
            m = scanner.nextInt();
            f = scanner.nextInt();
            r = scanner.nextInt();
        }
    }
}

