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