import java.util.Scanner;

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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(true){
			String grade = "";
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if(m == -1 && f == -1 && r== -1){
				scan.close();
				break;
			}else if(m == -1 || f == -1){
				grade = "F";
			}else if(80 <= m + f){
				grade = "A";
			}else if(65 <= m + f && m + f < 80){
				grade = "B";
			}else if(50 <= m + f && m + f < 65){
				grade = "C";
			}else if(30 <= m + f && m + f < 50){
				if(50 <= r){
					grade = "C";
				}else{
					grade = "D";
				}
			}else if(m + f < 30){
				grade = "F";
			}
			System.out.println(grade);
		}
	}
}