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