import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    }
} import java.util.*; util.* java public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    } main {
        Main main = new Main();
        main.solv();
    } Main main = new Main(); main new Main() main.solv() main.solv main String[] args args private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    } solv {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        } true {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        } int m = input.nextInt(); m input.nextInt() input.nextInt input int f = input.nextInt(); f input.nextInt() input.nextInt input int r = input.nextInt(); r input.nextInt() input.nextInt input if (m == -1 && f == -1 && r == -1) break; 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 break; char result; result if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F'; m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 result = 'F' result 'F' if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F'; m + f >= 80 m + f m f 80 result = 'A' result 'A' if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F'; m + f >= 65 m + f m f 65 result = 'B' result 'B' if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F'; m + f >= 50 m + f m f 50 result = 'C' result 'C' if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F'; m + f >= 30 m + f m f 30 {
                if (r >= 50) result = 'C';
                else result = 'D';
            } if (r >= 50) result = 'C';
                else result = 'D'; r >= 50 r 50 result = 'C' result 'C' result = 'D' result 'D' result = 'F' result 'F' System.out.println(result) System.out.println System.out System System.out result public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    }
} public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    }
} Main
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            int m = input.nextInt(); //中間
            int f = input.nextInt(); //期末
            int r = input.nextInt(); //再試験
            if (m == -1 && f == -1 && r == -1) break;
            
            char result;
            if (m == -1 || f == -1) result = 'F';
            else if (m + f >= 80) result = 'A';
            else if (m + f >= 65) result = 'B';
            else if (m + f >= 50) result = 'C';
            else if (m + f >= 30) {
                if (r >= 50) result = 'C';
                else result = 'D';
            } else result = 'F';
            
            System.out.println(result);
        }
    }
}