import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        }
    } import java.util.Scanner; Scanner java.util public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        }
    } Main public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        } main {
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        } int i=0 i 0 j j k k count=0; count 0 int a[]; a int b[]; b int c[]; c a = new int[100000] a new int[100000] 100000 b = new int[100000] b new int[100000] 100000 c = new int[100000] c new int[100000] 100000 Scanner n = new Scanner(System.in); n new Scanner(System.in) while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                } true {
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                } a[i] = n.nextInt() a[i] a i n.nextInt() n.nextInt n b[i] = n.nextInt() b[i] b i n.nextInt() n.nextInt n c[i] = n.nextInt() c[i] c i n.nextInt() n.nextInt n if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     } a[i]==-1 && b[i]==-1 && c[i]==-1 a[i]==-1 && b[i]==-1 && c[i]==-1 a[i]==-1 a[i] a i -1 1 b[i]==-1 b[i] b i -1 1 c[i]==-1 c[i] c i -1 1 {
                         break;
                     } break; count++ count i++ i i=0 i 0 while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                } count>i count i {
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                } int d = a[i]+b[i]; d a[i]+b[i] a[i] a i b[i] b i if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        } a[i]==-1 || b[i]==-1 a[i]==-1 a[i] a i -1 1 b[i]==-1 b[i] b i -1 1 {
                            System.out.printf("F");
                        } System.out.printf("F") System.out.printf System.out System System.out "F" if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        } d>=80 d 80 {
                            System.out.printf("A");
                        } System.out.printf("A") System.out.printf System.out System System.out "A" if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        } d>=65 && d<80 d>=65 d 65 d<80 d 80 {
                            System.out.printf("B");
                        } System.out.printf("B") System.out.printf System.out System System.out "B" if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        } d>=50 && d<65 d>=50 d 50 d<65 d 65 {
                            System.out.printf("C");
                        } System.out.printf("C") System.out.printf System.out System System.out "C" if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        } d>=30 && d<50 d>=30 d 30 d<50 d 50 {
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        } if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            } c[i]>=50 c[i] c i 50 {
                                System.out.printf("C");
                            } System.out.printf("C") System.out.printf System.out System System.out "C" {
                            System.out.printf("D");
                            } System.out.printf("D") System.out.printf System.out System System.out "D" if(d<30){
                            System.out.printf("F");
                        } d<30 d 30 {
                            System.out.printf("F");
                        } System.out.printf("F") System.out.printf System.out System System.out "F" i++ i System.out.printf("\n") System.out.printf System.out System System.out "\n" String[] args args public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        }
    } public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        }
    } Main
import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
            int i=0,j,k,count=0;
            int a[];
            int b[];
            int c[];
            a = new int[100000];
            b = new int[100000];
            c = new int[100000];
                Scanner n = new Scanner(System.in);
                while(true){
                     a[i] = n.nextInt();
                     b[i] = n.nextInt();
                     c[i] = n.nextInt();
                     if(a[i]==-1 && b[i]==-1 && c[i]==-1){
                         break;
                     }
                     count++;
                     i++;
                }
                i=0;
                while(count>i){
                    int d = a[i]+b[i];
                        if(a[i]==-1 || b[i]==-1){
                            System.out.printf("F");
                        }else if(d>=80){
                            System.out.printf("A");
                        }else if(d>=65 && d<80){
                            System.out.printf("B");
                        }else if(d>=50 && d<65){
                            System.out.printf("C");
                        }else if(d>=30 && d<50){
                            if(c[i]>=50){
                                System.out.printf("C");
                            }else{
                            System.out.printf("D");
                            }
                        }else if(d<30){
                            System.out.printf("F");
                        }
                     i++;
                     System.out.printf("\n");
                }
        }
    }
