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