import java.io.PrintWriter;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        }
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        }
        out.flush();
    }
} Main private static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) private static final PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] Args){
        while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        }
        out.flush();
    } main {
        while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        }
        out.flush();
    } while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        } true {
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        } final int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int f = Integer.parseInt(sc.next()); f Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int r = Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next 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; if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D'); m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 out.println('F') out.println out 'F' if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D'); m+f>=80 m+f m f 80 out.println('A') out.println out 'A' if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D'); m+f>=65 m+f m f 65 out.println('B') out.println out 'B' if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D'); m+f>=50 m+f m f 50 out.println('C') out.println out 'C' if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D'); m+f<30 m+f m f 30 out.println('F') out.println out 'F' if(r>=50) out.println('C');
            else out.println('D'); r>=50 r 50 out.println('C') out.println out 'C' out.println('D') out.println out 'D' out.flush() out.flush out String[] Args Args
import java.io.PrintWriter;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        while(true){
            final int m = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            if(m==-1&&f==-1&&r==-1) break;
            if(m==-1||f==-1) out.println('F');
            else if(m+f>=80) out.println('A');
            else if(m+f>=65) out.println('B');
            else if(m+f>=50) out.println('C');
            else if(m+f<30) out.println('F');
            else if(r>=50) out.println('C');
            else out.println('D');
        }
        out.flush();
    }
}