import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    }
} Main public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m; m int f; f int r; r int sum; sum int i = 0; i 0 char grade; grade while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        } i == 0 i 0 {
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        } grade = ' ' grade ' ' m = scan.nextInt() m scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan sum = m + f sum m + f m f if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            } 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 {
                i = 1;
            } i = 1 i 1 { 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            } if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
                        grade = 'F';
                } grade = 'F' grade 'F' {
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                } sum = m + f sum m + f m f if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    } sum >= 80 sum 80 {
                        grade = 'A';
                    } grade = 'A' grade 'A' if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    } sum >= 65 sum 65 {
                        grade = 'B';
                    } grade = 'B' grade 'B' if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    } sum >= 50 sum 50 {
                        grade = 'C';
                    } grade = 'C' grade 'C' if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    } sum < 30 sum 30 {
                        grade = 'F';
                    } grade = 'F' grade 'F' {
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    } if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        } r >= 50 r 50 {
                            grade = 'C';
                        } grade = 'C' grade 'C' {
                            grade = 'D';
                        } grade = 'D' grade 'D' System.out.println(grade) System.out.println System.out System System.out grade String[] args args public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    }
} public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    }
} Main
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int m;
        int f;
        int r;
        int sum;
        int i = 0;
        char grade;
        while(i == 0){
            grade = ' ';
            m = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            sum = m + f;
            if(m == -1 && f == -1 && r == -1){
                i = 1;
            }else{ 
                if(m == -1 || f == -1){
                        grade = 'F';
                }else{
                    sum = m + f;
                    if(sum >= 80){
                        grade = 'A';
                    }else if(sum >= 65){
                        grade = 'B';
                    }else if(sum >= 50){
                        grade = 'C';
                    }else if(sum < 30){
                        grade = 'F';
                    }else{
                        if(r >= 50){
                            grade = 'C';
                        }else{
                            grade = 'D';
                        }
                    }
                }
                System.out.println(grade);  
            }
        }
    }
}
